summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMarius Wachtler <marius.wachtler@ith-icoserve.com>2013-11-25 15:22:56 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-26 13:54:52 +0100
commit160656d68855bc09a44c19d1b0656668c0fa4046 (patch)
treeff1cc6a9bfaf65f8f7bf067d2d29711d8b5aac5a /src/plugins
parent6799e9eab0619598ece481243277b4b9f1d42db4 (diff)
Fix WMF Video not playing if no soundcard is available
Do not add the AudioEndpoint to the topology if no Audio output device is available. Fixes video not playing if you deactivate your soundcard or have no headphones/speakers plugged in. Change-Id: I9fc2486198a299b3e75af648f69475270968c6f7 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/wmf/player/mfaudioendpointcontrol.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/wmf/player/mfaudioendpointcontrol.cpp b/src/plugins/wmf/player/mfaudioendpointcontrol.cpp
index 39fc41c5f..c04e47f72 100644
--- a/src/plugins/wmf/player/mfaudioendpointcontrol.cpp
+++ b/src/plugins/wmf/player/mfaudioendpointcontrol.cpp
@@ -60,6 +60,8 @@ void MFAudioEndpointControl::clear()
foreach (LPWSTR wstrID, m_devices)
CoTaskMemFree(wstrID);
+ m_devices.clear();
+
if (m_currentActivate)
m_currentActivate->Release();
m_currentActivate = NULL;
@@ -130,6 +132,11 @@ IMFActivate* MFAudioEndpointControl::createActivate()
clear();
updateEndpoints();
+
+ // Check if an endpoint is available ("Default" is always inserted)
+ if (m_devices.count() <= 1)
+ return NULL;
+
setActiveOutput(m_defaultEndpoint);
return m_currentActivate;