[FFmpeg-devel] [PATCH] avio: Check for FF_NETERROR(EAGAIN) in retry_transfer_wrapper
Måns Rullgård
mans
Thu Feb 17 15:36:47 CET 2011
Martin Storsj? <martin at martin.st> writes:
> 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)) {
Wouldn't it be better to do this in the network layer?
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list