From df73b1a324cbdadae9e4128879fdaa65dd7d2a77 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 16 May 2011 18:02:58 +0200 Subject: Fix a problem where the video would'nt show on some containers The problem was linked to the detection of a video stream in the graph. Only the decoders were tested but the demuxer can directly provide the video stream. Reviewed-By: TrustMe Task-Number: QTBUG-19348 --- src/3rdparty/phonon/ds9/mediagraph.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/3rdparty/phonon/ds9/mediagraph.cpp b/src/3rdparty/phonon/ds9/mediagraph.cpp index 3e7a68b..153cd7e 100644 --- a/src/3rdparty/phonon/ds9/mediagraph.cpp +++ b/src/3rdparty/phonon/ds9/mediagraph.cpp @@ -781,6 +781,23 @@ namespace Phonon } } + const QList demuxOutputs = BackendNode::pins(m_demux, PINDIR_OUTPUT); + for (int i = 0; i < demuxOutputs.count(); ++i) { + //...and the output must be decoded + QAMMediaType type; + hr = demuxOutputs.at(i)->ConnectionMediaType(&type); + if (FAILED(hr)) { + continue; + } + + if (type.majortype == MEDIATYPE_Video) { + m_hasVideo = true; + } else if (type.majortype == MEDIATYPE_Audio) { + m_hasAudio = true; + } + } + + for (int i = 0; i < m_decoders.count(); ++i) { QList chain = getFilterChain(m_demux, m_decoders.at(i)); for (int i = 0; i < chain.count(); ++i) { @@ -806,14 +823,11 @@ namespace Phonon } //we need to do something smart to detect if the streams are unencoded - if (m_demux) { - const QList outputs = BackendNode::pins(m_demux, PINDIR_OUTPUT); - for (int i = 0; i < outputs.count(); ++i) { - const OutputPin &out = outputs.at(i); - InputPin pin; - if (out->ConnectedTo(pin.pparam()) == HRESULT(VFW_E_NOT_CONNECTED)) { - m_decoderPins += out; //unconnected outputs can be decoded outputs - } + for (int i = 0; i < demuxOutputs.count(); ++i) { + const OutputPin &out = demuxOutputs.at(i); + InputPin pin; + if (out->ConnectedTo(pin.pparam()) == HRESULT(VFW_E_NOT_CONNECTED)) { + m_decoderPins += out; //unconnected outputs can be decoded outputs } } -- cgit v0.12