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

Luca Abeni lucabe72
Tue Mar 3 19:06:03 CET 2009

Reimar D?ffinger wrote:
>>> 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
> As I understand it the issue is "near-100% CPU usage". In that case both
> are nonsense, and usleep(10000) or so comes closest to correct.

Yes, I agree that usleep(10000) is a possible solution. Not nice (as 
said in my previous email, I was wondering if we can do a "smarter" 
usleep()), but a solution. We just need to take some care in 
dimensioning the "10000" constant.


More information about the ffmpeg-devel mailing list