Re: Crash on seek and stop
- From: Geraint Davies <geraintd@xxxxxxxxxx>
- Date: Fri, 29 Sep 2006 10:47:31 +0100
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
.
- Follow-Ups:
- Re: Crash on seek and stop
- From: czalkin
- Re: Crash on seek and stop
- Prev by Date: Re: WTL SubclassWindow and dshow.h cause error
- Next by Date: Linker Fehler beim Compilieren von DirectShow Sample
- Previous by thread: WTL SubclassWindow and dshow.h cause error
- Next by thread: Re: Crash on seek and stop
- Index(es):
Relevant Pages
|