[FFmpeg-devel] [PATCH] avio: Check for FF_NETERROR(EAGAIN) in retry_transfer_wrapper

Måns Rullgård mans
Thu Feb 17 14:39:36 CET 2011


Nicolas George <nicolas.george at normalesup.org> writes:

> Le nonidi 29 pluvi?se, an CCXIX, Martin Storsj? a ?crit?:
>> On Windows, FF_NETERROR(EAGAIN) isn't equal to AVERROR(EAGAIN).
>
> Grmpf.
>
>>          if (h->flags & URL_FLAG_NONBLOCK)
>>              return ret;
>> -        if (ret == AVERROR(EAGAIN)) {
>> +        if (ret == AVERROR(EAGAIN) || ret == FF_NETERROR(EAGAIN)) {
>
> If URL_FLAG_NONBLOCK is set, the non-standard return code escapes to the
> caller, this is not acceptable, especially since the caller can be a
> non-ffmpeg application, and therefore not have access to FF_* symbols.
>
> I see two possibles fixes for both problem:
>
> Either insert this just before the test for URL_FLAG_NONBLOCK:
> 	if (ret == FF_NETERROR(EAGAIN)) ret = AVERROR(EAGAIN);
>
> Or change the definition of FF_NETERROR and ff_neterrno() to map
> WSAEWOULDBLOCK to EAGAIN.

I would prefer a solution that turns the code into the standard EAGAIN
as early as possible, preferably within the network layer.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list