[FFmpeg-devel] [PATCH] Yield on AVERROR(EAGAIN).

Ronald S. Bultje rsbultje
Fri Mar 5 03:24:14 CET 2010


Hi,

On Mar 4, 2010, at 9:13 PM, M?ns Rullg?rd <mans at mansr.com> wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
>> On Thu, Mar 04, 2010 at 09:22:44PM -0300, Ramiro Polla wrote:
>>> Hi,
>>>
>>> Currently FFmpeg eats 100% cpu on devices that return EAGAIN.  
>>> Attached
>>> patch makes FFmpeg yield when it gets EAGAIN. In Windows it gets  
>>> down
>>> to normal cpu levels, but on Linux this didn't work as I expected,  
>>> it
>>> still eats 100% cpu.
>>
>>> Any ideas?
>>
>> try it with 2 processes of equal priority
>> without yield they should be 50% each if one yields the other  
>> should get
>> 100% in theory
>>
>>>
>>> Ramiro Polla
>>
>>> ffmpeg.c                 |    1 +
>>> libavformat/os_support.h |   16 ++++++++++++++++
>>> libavformat/utils.c      |    5 ++++-
>>> 3 files changed, 21 insertions(+), 1 deletion(-)
>>> 500496eb221c93827504d8eb615c143c82f532a1  ff_yield.diff
>>
>> ok
>
> Not OK.

I was about to question my (or really, Michael's) sanity already...

Ronald



More information about the ffmpeg-devel mailing list