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

Nicolas George nicolas.george
Thu Feb 17 14:33:35 CET 2011


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.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110217/395f9768/attachment.pgp>



More information about the ffmpeg-devel mailing list