Re: hang playing video...
- From: "Chris P. [MVP]" <msdn@xxxxxxxxxxxx>
- Date: Fri, 14 Jul 2006 11:22:34 -0400
On Thu, 13 Jul 2006 16:38:43 -0700, Phil in San Diego wrote:
"Chris P. [MVP]" wrote:
The message from GraphEdit is a timeout while it is waiting for the
notification. Obviously this notification is never occurring so the only
option is for GraphEdit to give up the wait.
for which notification?
The EC_COMPLETE. The default behaviour is that the filter graph manager
sucks up the EC_COMPLETE messages from each renderer and then delivers an
EC_COMPLETE to the application once it has received the correct number of
EC_COMPLETE messages. If it never gets enough you will never receive the
message. There is a way to change this so that you would receive the
notifications for each renderer but I forget how that goes ...
It would also seem that your renderer's or not sending out an EC_COMPLETE
which would indicate that it is not receive the end of stream notification.
The filter graph manager will be waiting for 2 of these one for each
stream.
If you video renderer was simply waiting for the render time for the frame,
calling stop should release the sample. So it would seem something more
sinister is going on. Sometimes it's useful to hit pause in the debugger
and then look at each thread to see where it is at and where it is stuck.
But I don't call stop, the filter graph manager does... right? - and that's
what I'm not getting - the stop call.
Are you receiving a pause?
I am using COutputQueue in both the output pins of my source. When i get a
DeliverEndOfStream() call, I call m_pOutputQueue->EOS(). I was not calling
__super::DeliverEndOfStream() - I added that in, and it didn't seem to make a
difference.
So, I'm sure now that I'm calling base::DeliverEndOfStream() on both output
pins of my source, yet I still get the same exact behavior. I should not
need to do anything after DeliverEndOfStream (like send empty media samples
or something like that) before I get the Stop() command on my filter, right?
You should use the COutputQueue EOS when using output queues, otherwise you
can have timing issues with samples being send after the
DeliverEndOfStream() which is a big no no. BTW you have to be very careful
with COutputQueue's as they run their own thread for delivery. It's very
easy to get caught in a CAutoLock deadlock.
I use the following to debug lock deadlocks:
// locks a critical section, and unlocks it automatically
// when the lock goes out of scope
class CAutoLockDebug {
// make copy constructor and assignment operator inaccessible
CAutoLockDebug(const CAutoLockDebug &refAutoLock);
CAutoLockDebug &operator=(const CAutoLockDebug &refAutoLock);
protected:
CCritSec * m_pLock;
CString m_sModule;
int m_iLine;
public:
CAutoLockDebug(CCritSec * plock, int iLine, LPCTSTR szModule)
{
m_pLock = plock;
#ifdef DEBUG_AUTOLOCK
CString temp;
m_iLine = iLine;
m_sModule = szModule;
temp.Format("LockDebug: lock %x - line %i in %s", plock, iLine,
szModule);
OutputDebugString(temp);
#endif
m_pLock->Lock();
};
~CAutoLockDebug() {
#ifdef DEBUG_AUTOLOCK
CString temp;
temp.Format("LockDebug: unlock %x - line %i in %s", m_pLock, m_iLine,
m_sModule);
OutputDebugString(temp);
#endif
m_pLock->Unlock();
};
};
Then from code replace
CAutoLock cLock(&myCrit)
with
CAutoLockDebug cLock(&myCrit, __LINE__, __FILE__);
p.s. By the way, I *really* appreciate all your help.
No problem.
--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
.
- Follow-Ups:
- Re: hang playing video...
- From: Phil in San Diego
- Re: hang playing video...
- References:
- Re: hang playing video...
- From: Chris P. [MVP]
- Re: hang playing video...
- From: Chris P. [MVP]
- Re: hang playing video...
- From: Chris P. [MVP]
- Re: hang playing video...
- Prev by Date: RE: Extract PCM sample data from movie files
- Next by Date: Re: Windows Audio Drift
- Previous by thread: Re: hang playing video...
- Next by thread: Re: hang playing video...
- Index(es):
Relevant Pages
|