[FFmpeg-devel] [PATCH] What is missing for working AVFMT_FLAG_NONBLOCK?

Michael Niedermayer michaelni
Tue Mar 3 17:48:06 CET 2009

On Tue, Mar 03, 2009 at 05:19:05PM +0100, Luca Abeni wrote:
> Michael Niedermayer wrote:
> > On Tue, Mar 03, 2009 at 05:01:16PM +0100, Luca Abeni wrote:
> >> Hi Michael,
> >>
> >> Michael Niedermayer wrote:
> >> [...]
> >>>> I tested capturing some audio with the two attached patches (without them,
> >>>> nothing changes...) and it seems to me that this is working (easy,,, I
> >>>> only have a single input ;-). I see a near-100% CPU load, so I guess a
> >>>> usleep() somewhere (or something similar) is really needed.
> >>> sched_yield() should be added IMHO, usleep() just feels like the wrong thing
> >> AFAIK, sched_yield() on non real-time task is not a good idea (it has an
> >> undefined behaviour).
> > 
> > which page of POSIX says that?, i cant find it ...
> I think POSIX defines the sched_yield() behaviour only for SCHED_FIFO and
> SCHED_RR (basically, a task is moved at the end of its priority's queue).
> opengroup.org says:
> The sched_yield() function shall force the running thread to relinquish the processor until it again becomes the head of its thread list. It takes no arguments:
> http://www.opengroup.org/onlinepubs/000095399/
> The problem is that (AFAIK) the concept of "head of its thread list" only
> makes sense for fifo and rr.

are you saying that sched_yield() will blow up and cause actual undefined
behaviour and that we should use usleep(0) or what else?
I really feel that sched_yield() is correct and usleep() is not.
thats IMHO from reading POSIX and the man pages


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090303/9f6f355d/attachment.pgp>

More information about the ffmpeg-devel mailing list