[xiph-commits] r16938 - trunk/oggdsf/src/lib/plugin/AxPlayer
cristianadam at svn.xiph.org
cristianadam at svn.xiph.org
Sun Feb 28 14:48:01 PST 2010
Author: cristianadam
Date: 2010-02-28 14:48:01 -0800 (Sun, 28 Feb 2010)
New Revision: 16938
Modified:
trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.cpp
trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.h
Log:
Fixed rendering videos without audio.
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.cpp 2010-02-28 21:51:41 UTC (rev 16937)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.cpp 2010-02-28 22:48:01 UTC (rev 16938)
@@ -54,7 +54,9 @@
FilterGraph::FilterGraph() :
m_customVmrAllocator(0),
m_notifyWindow(0),
-m_presentImageMessage(0)
+m_presentImageMessage(0),
+m_haveAudio(true),
+m_haveVideo(true)
{
}
@@ -120,13 +122,27 @@
CComPtr<IPin> vorbisDemuxOut = DShowUtil::FindPin(m_oggSource, PINDIR_OUTPUT, 1);
CComPtr<IPin> vorbisDecoderIn = DShowUtil::FindPin(m_vorbisDecoder, PINDIR_INPUT, 0);
- CHECK_HR(m_graphBuilder->Connect(vorbisDemuxOut, vorbisDecoderIn));
+ if (vorbisDemuxOut)
+ {
+ CHECK_HR(m_graphBuilder->Connect(vorbisDemuxOut, vorbisDecoderIn));
+ }
+ else
+ {
+ m_haveAudio = false;
+ }
// Connect theora decoder
CComPtr<IPin> theoraDemuxOut = DShowUtil::FindPin(m_oggSource, PINDIR_OUTPUT, 0);
CComPtr<IPin> theoraDecoderIn = DShowUtil::FindPin(m_theoraDecoder, PINDIR_INPUT, 0);
- CHECK_HR(m_graphBuilder->Connect(theoraDemuxOut, theoraDecoderIn));
+ if (theoraDemuxOut)
+ {
+ CHECK_HR(m_graphBuilder->Connect(theoraDemuxOut, theoraDecoderIn));
+ }
+ else
+ {
+ m_haveVideo = false;
+ }
}
void FilterGraph::AddRenderers()
@@ -146,13 +162,19 @@
CComPtr<IPin> vorbisDecoderOut = DShowUtil::FindPin(m_vorbisDecoder, PINDIR_OUTPUT, 0);
CComPtr<IPin> audioRendererIn = DShowUtil::FindPin(m_audioRenderer, PINDIR_INPUT, 0);
- CHECK_HR(m_graphBuilder->Connect(vorbisDecoderOut, audioRendererIn));
+ if (m_haveAudio)
+ {
+ CHECK_HR(m_graphBuilder->Connect(vorbisDecoderOut, audioRendererIn));
+ }
// Connect video renderer
CComPtr<IPin> theoraDecoderOut = DShowUtil::FindPin(m_theoraDecoder, PINDIR_OUTPUT, 0);
CComPtr<IPin> videoRendererIn = DShowUtil::FindPin(m_videoRenderer, PINDIR_INPUT, 0);
- CHECK_HR(m_graphBuilder->Connect(theoraDecoderOut, videoRendererIn));
+ if (m_haveVideo)
+ {
+ CHECK_HR(m_graphBuilder->Connect(theoraDecoderOut, videoRendererIn));
+ }
}
void FilterGraph::ConfigureVideoRenderer()
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.h 2010-02-28 21:51:41 UTC (rev 16937)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.h 2010-02-28 22:48:01 UTC (rev 16938)
@@ -88,6 +88,9 @@
HWND m_notifyWindow;
int m_presentImageMessage;
+
+ bool m_haveAudio;
+ bool m_haveVideo;
};
#endif // FILTERGRAPH_H
More information about the commits
mailing list