summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Belyavsky <belyavskyv@gmail.com>2024-02-29 10:05:05 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-01 19:44:58 +0000
commitf9e44002c5ca3e15e7901d8cbf524fb3fc786202 (patch)
tree954fba6949a8c018a1e746a199d5f59f14338744
parentd12f948d8d51dfa49a598766d72fe774c71b8124 (diff)
windows: fix video playback when audio output is not specified
When setting up the topology in MFPlayerSession, we add source and output nodes for each source stream. But in case when output node can't be created for some reason, e.g. this is an audio node and audio output is not specified (m_audioOutput == nullptr), we may result in an error on setting the topology (IMFMediaSession::SetTopology), like "A stream descriptor was set on a source stream node but it was not selected on the presentation descriptor." Therefore it was causing an issue where the video would not play at all. To fix this, we need to simply remove the source node from the topology if the output node cannot be created. Fixes: QTBUG-122608 Fixes: QTBUG-122817 Pick-to: 6.5 Change-Id: I046a78a257890b1d1c182f5f1e3dc48761985afa Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit b59bf3fd57c4cebd853ac96a505c1b249c00e5f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 961961da77b8064fe3d923da1f55b48ff0e85313)
-rw-r--r--src/plugins/multimedia/windows/player/mfplayersession.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/multimedia/windows/player/mfplayersession.cpp b/src/plugins/multimedia/windows/player/mfplayersession.cpp
index c6f922806..16cba7266 100644
--- a/src/plugins/multimedia/windows/player/mfplayersession.cpp
+++ b/src/plugins/multimedia/windows/player/mfplayersession.cpp
@@ -359,6 +359,9 @@ void MFPlayerSession::setupPlaybackTopology(IMFMediaSource *source, IMFPresentat
break;
}
}
+ } else {
+ // remove the source node if the output node cannot be created
+ topology->RemoveNode(sourceNode.Get());
}
}
}