[FFmpeg-devel] [PATCH] avio: Check for FF_NETERROR(EAGAIN) in retry_transfer_wrapper
Luca Barbato
lu_zero
Thu Feb 17 15:26:25 CET 2011
On 02/17/2011 02:39 PM, Martin Storsj? wrote:
> On Windows, FF_NETERROR(EAGAIN) isn't equal to AVERROR(EAGAIN).
> Map the return value visible to user applications to the normal
> AVERROR() codes.
>
> This fixes issue 2614.
> ---
> libavformat/avio.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/libavformat/avio.c b/libavformat/avio.c
> index a19ec37..eca6ad2 100644
> --- a/libavformat/avio.c
> +++ b/libavformat/avio.c
> @@ -219,6 +219,8 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
> ret = transfer_func(h, buf+len, size-len);
> if (ret == AVERROR(EINTR))
> continue;
> + if (ret == FF_NETERROR(EAGAIN))
> + ret = AVERROR(EAGAIN);
> if (h->flags & URL_FLAG_NONBLOCK)
> return ret;
> if (ret == AVERROR(EAGAIN)) {
Seems good, are there other window-corner cases around?
lu
--
Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero
More information about the ffmpeg-devel
mailing list