diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2009-11-12 05:27:25 (GMT) |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2009-11-12 05:31:59 (GMT) |
commit | 300ab260c96d1e0a28f44d7e6c1d80b6124efd6c (patch) | |
tree | f1e70fe42be463219eb7a28915246c28dd766814 | |
parent | 857aaee6d6f394eb9dd8dd9a56692cf85bc52581 (diff) | |
download | Qt-300ab260c96d1e0a28f44d7e6c1d80b6124efd6c.zip Qt-300ab260c96d1e0a28f44d7e6c1d80b6124efd6c.tar.gz Qt-300ab260c96d1e0a28f44d7e6c1d80b6124efd6c.tar.bz2 |
Fix compilation of Phonon DS9 backend when Qt is built statically.
qt_plugin_instance() isn't defined in a static build. Assign a pointer
the shared mutex to static member variable in the backend constructor,
rather than returning it from a static member function.
Task-number: QTBUG-5207
Reviewed-by: Justin McPherson
-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/mediaobject.cpp | 2 |
3 files changed, 7 insertions, 6 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/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()) { |