Re: hang playing video...



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
.



Relevant Pages

  • Re: A little threading problem
    ... > forever (because it doesn't get notified, because the notification ... > already happened), waiting to be notified from the main thread, and the ... T-B: released mainCond ... As for what I'm trying to do; I'm trying to merge three huge XML files ...
    (comp.lang.python)
  • Re: Implementing Java like synchronization with the OS/2 API in C++
    ... I am currenly trying to implement the notification semantic like ... notifyallfunction wakes us all threads waiting on this instance. ... Additionally all of these functions must be called while the current thread owns the mutex semaphore associated with this object. ... The monitor thread would keep a list of handles TID/PIDs to notify and post the event when it happens. ...
    (comp.os.os2.programmer.misc)
  • Implementing Java like synchronization with the OS/2 API in C++
    ... But I did not succeed in the second part, the notification logic. ... The notifyallfunction wakes us all threads waiting on this instance. ... needs to release the mutex semaphore while waiting for the notification ... So I have to wait for an event semaphore and a ...
    (comp.os.os2.programmer.misc)
  • Re: can not get phone calls
    ... To summarize, you have a single phone line with the Call Waiting service, ... call and putting the Internet "on hold". ... internet connection, but I doubt that ordinary Call Waiting from your phone ... > used to get phone calls notification on the screen until Jan.05 then I got ...
    (microsoft.public.windowsxp.general)