summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2009-11-12 04:46:06 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2009-11-12 05:31:57 (GMT)
commit857aaee6d6f394eb9dd8dd9a56692cf85bc52581 (patch)
tree0dad0cbd5c9368d4dd4e1ed868a3680e90483145 /src/3rdparty/phonon
parent47ea499acb8bed716362c2be7c52dd57b37b830f (diff)
downloadQt-857aaee6d6f394eb9dd8dd9a56692cf85bc52581.zip
Qt-857aaee6d6f394eb9dd8dd9a56692cf85bc52581.tar.gz
Qt-857aaee6d6f394eb9dd8dd9a56692cf85bc52581.tar.bz2
Fix assert on windows when deleting phonon nodes from a running graph.
If removing a filter from the direct show graph fails because it is running, stop the graph and try again. Task-number: QTBUG-5011 Reviewed-by: Justin McPherson
Diffstat (limited to 'src/3rdparty/phonon')
-rw-r--r--src/3rdparty/phonon/ds9/backendnode.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/3rdparty/phonon/ds9/backendnode.cpp b/src/3rdparty/phonon/ds9/backendnode.cpp
index 855357a..3afcafa 100644
--- a/src/3rdparty/phonon/ds9/backendnode.cpp
+++ b/src/3rdparty/phonon/ds9/backendnode.cpp
@@ -58,7 +58,24 @@ namespace Phonon
BackendNode::~BackendNode()
{
//this will remove the filter from the graph
- mediaObjectDestroyed();
+ FILTER_INFO info;
+ for(int i = 0; i < FILTER_COUNT; ++i) {
+ const Filter &filter = m_filters[i];
+ if (!filter)
+ continue;
+ filter->QueryFilterInfo(&info);
+ if (info.pGraph) {
+ HRESULT hr = info.pGraph->RemoveFilter(filter);
+
+ if (hr == VFW_E_NOT_STOPPED && m_mediaObject) {
+ m_mediaObject->ensureStopped();
+
+ hr = info.pGraph->RemoveFilter(filter);
+ }
+ Q_ASSERT(SUCCEEDED(hr));
+ info.pGraph->Release();
+ }
+ }
}
void BackendNode::setMediaObject(MediaObject *mo)