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

Luca Abeni lucabe72
Tue Mar 3 17:01:16 CET 2009


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).

I had this strange idea of trying "-re", but it does not work correctly with
live sources (I suspect there is a positive feedback or something like that).
I'll have a look in the next days to see if there is some way to make it work
with live sources and AVFMT_FLAG_NONBLOCK.

In the meanwhile, I have no objections for your latest patch (if it breaks
something we'll fix it in some way).



				Luca




More information about the ffmpeg-devel mailing list