Re: Crash on seek and stop

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On 28 Sep 2006 08:31:11 -0700, czalkin@xxxxxxxxx wrote:

I have inherited control of a video recording playback system and it is
up to me to solve some freezing bugs. I've never worked with
directshow (or C#, which this program was written in).

The system hangs on a call to IMediaControl::Stop() as well as on
IMediaSeeking::SetPositions() (These are the C# wrapper names, I
assume they are the same as the native com object names) This seems to
be a common issue on the newsgroups, but I can't find a common
solution. Is there a list of usual suspects I can look for?

I have tried to call Pause() before Stop(), and added a delay between
them, but that didn't seem to help. The application is still running,
but breaking in with the debugger can't trace below the Stop() call. I
don't have any threads running that seem to interfere with the stopping
of the playback, but maybe there's some interaction that isn't obvious
(in which case, what's a good thing to look for?)

Perhaps the filtergraph is set up incorrectly? I can post a version of
that code if someone cares to help me look at it.


Thanks!

This is not going to be easy for you to debug. The stop is probably waiting
for one of the worker threads that is blocked inside a filter.

The graph will pause before stopping or seeking. A thread originating in a
source or demux filter will be calling down through a number of filters,
but when the graph is paused it will block, probably waiting for GetBuffer
to release another buffer, which it will not do while paused.

The app thread then tries to stop the graph. The filter owning the thread
should call flush and then wait for its thread to exit before stopping, and
it is probably at this stage that you are seeing the hang. Flush will
release any buffers and should prevent the worker thread blocking, but it
needs to be passed right down the graph. I would think that either the
flush is not being passed down the graph or the worker thread is not
checking the stop signal correctly. Either way, the problem is somewhere in
the filters and not in your app code.

G
.



Relevant Pages

  • AddSourceFilterForMoniker() locks up sometimes.
    ... I've coded a simple filter graph to capture frames from a video camera ... I can grab frames from the Sample Grabber with no ...
    (microsoft.public.multimedia.directx.dshow.programming)
  • AddSourceFilterForMoniker() locks up sometimes.
    ... I've coded a simple filter graph to capture frames from a video camera ... I can grab frames from the Sample Grabber with no ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Confusing message from GraphEdit
    ... GetState to the filter graph I walked thru the list of the filters and asked ... From GraphEdit I press Run and Pause - works fine. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Crash on seek and stop
    ... for one of the worker threads that is blocked inside a filter. ... The graph will pause before stopping or seeking. ... // MPEG-2 Stream Splitter ... IPin splitterInputPin = RpsUtils.getPin(mpgSplitterIntfc, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Using WMAsfWriter with a file-based push-source
    ... I had also other problems with the CyberLink MPEG-2 Decoder. ... refused to add another instance of itself onto the filter graph. ... IGraphBuilder::Renderadded another decoder filter instead, ... > So it seems the demux filter depends on the graph clock to run correctly. ...
    (microsoft.public.multimedia.directx.dshow.programming)