1
votes

I'm using DirectShow to play audio/video files in my application. I use IGraphBuilder::RenderFile() to build the filter graph and the IMediaControl interface to play/pause/stop the media. This works fine for local media files, but causes problems with live mms streams.

If I call IMediaControl::Stop() on a live stream, the stream will stop playing as expected. However, if I call IMediaControl::Run() to resume the stream, nothing happens. The graph generates an EC_COMPLETE event, but the video does not play anymore.

Calling IMediaControl::Pause() followed by IMediaControl::Run() will resume the stream where it left off, but will eventually stop. It seems to just playback the data that was in the buffer when IMediaControl::Pause() was called, instead of re-syncing with the live stream.

Does anybody know how to resume playing a live stream without destroying and rebuilding the filter graph?

2
Do you know what filters are being added to the graph? - heavyd
GraphEdit shows "ASF ACM Handler" + "WMAudio Decoder DMO" filters for audio and "ASF ICM Handler" + "WMVideo Decoder DMO" filters for video. I have the same problem stopping and resuming the stream using the "Render URL" option in GraphEdit. I'm using the Sky News live feed for testing (mms://live1.wm.skynews.servecast.net/skynews_wmlz_live300k) - flashk
Have you tried IMediaControl::Pause() instead of ::Stop()? This might or might not work depending on the implementation of the source or any of the filters, and it also depends on the properties of the stream. - Rom
What are your source/demux filters? - heavyd
It uses "Windows Media Source Filter" as the source filter. If I Pause() then Run() the graph, it will continue where the Pause() occurred, but it will stop buffering. So it seems to just play whatever is remaining in the buffer and then stop. - flashk

2 Answers

2
votes

The behavior indicates that one of the filters in the graph exhibits buggy behavior. The filter has to be replaced if you want to be able to re-run the feed. Also there is no good source filter to render mms:// streams which are obsolete themselves as protocol. Windows Media Player in Windows 7 is using its private DirectShow filter which is not available to applications. You might end up using custom source filter based on Windows Media Format SDK, or a third party replacement.

UPDATE: In Windows XP, mms:// URLs are rednered by Windows Media Splitter filter (wmpasf.dll). It is obviously responsible for the bug in question. So, if you are still going to use it, you might have to remove, re-add a new instance of the filter and re-render its pins in order to restart streaming. As I mentioned, this filter is no longer available in more recent versions of Windows (Windows 7 at the very least).

2
votes
  1. Why are you calling Stop()? you should call Pause()
  2. The DirectShow Filters for MMS are know to have problems with MMS, for starters they don't support the latest MMS 9 (that comes with Win 2003) protocol. You should use the Media Player Control or the Format SDK if you want proper support for MMS.