diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2009-11-12 06:33:53 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2009-11-12 06:33:53 (GMT) |
commit | 7286f4046b3e30fbbaa6951c6cc78c66cb84860b (patch) | |
tree | 5881cd57ebaebb8277b028ba95d3a3001cca9e7f | |
parent | 118412e46f5b5af58eaa3012f9fb086894f9b5f2 (diff) | |
parent | 300ab260c96d1e0a28f44d7e6c1d80b6124efd6c (diff) | |
download | Qt-7286f4046b3e30fbbaa6951c6cc78c66cb84860b.zip Qt-7286f4046b3e30fbbaa6951c6cc78c66cb84860b.tar.gz Qt-7286f4046b3e30fbbaa6951c6cc78c66cb84860b.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-multimedia-team into 4.6
-rw-r--r-- | src/3rdparty/phonon/ds9/backend.cpp | 9 | ||||
-rw-r--r-- | src/3rdparty/phonon/ds9/backend.h | 2 | ||||
-rw-r--r-- | src/3rdparty/phonon/ds9/backendnode.cpp | 19 | ||||
-rw-r--r-- | src/3rdparty/phonon/ds9/mediaobject.cpp | 2 |
4 files changed, 25 insertions, 7 deletions
diff --git a/src/3rdparty/phonon/ds9/backend.cpp b/src/3rdparty/phonon/ds9/backend.cpp index 6ed0145..fbc4bdc 100644 --- a/src/3rdparty/phonon/ds9/backend.cpp +++ b/src/3rdparty/phonon/ds9/backend.cpp @@ -41,6 +41,8 @@ namespace Phonon { namespace DS9 { + QMutex *Backend::directShowMutex = 0; + bool Backend::AudioMoniker::operator==(const AudioMoniker &other) { return other->IsEqual(*this) == S_OK; @@ -50,6 +52,8 @@ namespace Phonon Backend::Backend(QObject *parent, const QVariantList &) : QObject(parent) { + directShowMutex = &m_directShowMutex; + ::CoInitialize(0); //registering meta types @@ -62,11 +66,8 @@ namespace Phonon m_audioOutputs.clear(); m_audioEffects.clear(); ::CoUninitialize(); - } - QMutex *Backend::directShowMutex() - { - return &qobject_cast<Backend*>(qt_plugin_instance())->m_directShowMutex; + directShowMutex = 0; } QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args) diff --git a/src/3rdparty/phonon/ds9/backend.h b/src/3rdparty/phonon/ds9/backend.h index 8b020c2..7c3c109 100644 --- a/src/3rdparty/phonon/ds9/backend.h +++ b/src/3rdparty/phonon/ds9/backend.h @@ -64,7 +64,7 @@ namespace Phonon Filter getAudioOutputFilter(int index) const; - static QMutex *directShowMutex(); + static QMutex *directShowMutex; Q_SIGNALS: void objectDescriptionChanged(ObjectDescriptionType); 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) diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp index 250b94a..106a4c8 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.cpp +++ b/src/3rdparty/phonon/ds9/mediaobject.cpp @@ -177,7 +177,7 @@ namespace Phonon void WorkerThread::handleTask() { - QMutexLocker locker(Backend::directShowMutex()); + QMutexLocker locker(Backend::directShowMutex); { QMutexLocker locker(&m_mutex); if (m_finished || m_queue.isEmpty()) { |