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>
This commit is contained in:
committed by
The Qt Project
parent
6799e9eab0
commit
160656d688
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user