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

Michael Niedermayer michaelni
Tue Mar 3 15:21:41 CET 2009

On Tue, Mar 03, 2009 at 02:01:48PM +0100, Luca Abeni wrote:
> Hi Michael,
> Michael Niedermayer wrote:
>> On Tue, Mar 03, 2009 at 03:06:21AM +0100, Michael Niedermayer wrote:
>>> Hi
>>> AVFMT_FLAG_NONBLOCK is not enabled in ffmpeg/ffplay.c
>>> what is missing for it?
>>> capturing from several devices is likely going to work better if they
>>> dont block. And yes i know it all should be using select() but that is
>>> harder. And simple polling with non blocking demuxers should already
>>> work pretty well.
> I guess you want to set AVFMT_FLAG_NONBLOCK on input files, right?
> It seems to me that your patch sets it on the output... The attached
> fix-ffmpeg-nonblock.diff sets the flag for the inputs too (I hope ;-).

yes :)

> I tried it, and it already uncovered a small bug in the alsa input
> device (see attached fix-alsa-nonblock.diff.

ok (if iam supposed to review it ...)

> 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

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- 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/bb1901ae/attachment.pgp>

More information about the ffmpeg-devel mailing list