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

Martin Storsjö martin
Thu Feb 17 14:39:37 CET 2011


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)) {
-- 
1.7.3.1




More information about the ffmpeg-devel mailing list