gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Re: Burning 100% CPU time: MediaParser/FLVParser never p


From: strk
Subject: Re: [Gnash-dev] Re: Burning 100% CPU time: MediaParser/FLVParser never pauses
Date: Sun, 8 Aug 2010 22:21:14 +0200

On Sat, Aug 07, 2010 at 10:53:40PM +0200, strk wrote:
> On Thu, Aug 05, 2010 at 07:46:33PM -0700, John Gilmore wrote:
> > This patch seems to fix this problem in gnash:
> > 
> > === modified file 'libmedia/MediaParser.cpp'
> > --- libmedia/MediaParser.cpp        2010-01-01 17:48:26 +0000
> > +++ libmedia/MediaParser.cpp        2010-08-06 02:34:19 +0000
> > @@ -411,7 +411,10 @@
> >     while (!parserThreadKillRequested())
> >     {
> >             parseNextChunk();
> > -           gnashSleep(100); // no rush....
> > +           {
> > +                   boost::mutex::scoped_lock lock(_qMutex);
> > +                   waitIfNeeded(lock);
> > +           }
> >     }
> >  }
> 
> I think 'parseNextChunk' is supposed to call waitIfNeeded, but
> it's been a long time...

Took a look, parseNextChunk eventually calls push{Video,Audio}Frame
which in turn (in base class) calls waitIfNeeded (having the
AV queue already locked).

Your patch seems fine, and could eventually also make the call
to waitIfNeeded deep in pushAVFrame needless.

Watch out for deadlocks, if you don't get any go ahead and commit
it for broader testing.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]