[FFmpeg-devel] [PATCH] lavf/async: Fix wrapped_url_read return value

Guangyu Sun sunguangyucn at gmail.com
Mon Sep 19 08:22:39 EEST 2022


This fixes a regression from commit 36117968ad.

wrapped_url_read() used to be able to return positive number from
ffurl_read(). It relies on the result to check if EOF is reached in
async_buffer_task().

Test case:
  ffmpeg -f lavfi -i testsrc -t 1 test.mp4
  ffmpeg -i async:test.mp4

Signed-off-by: Guangyu Sun <gsun at roblox.com>
---
 libavformat/async.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/async.c b/libavformat/async.c
index 547417aa1e..a929f4d16e 100644
--- a/libavformat/async.c
+++ b/libavformat/async.c
@@ -139,7 +139,7 @@ static int wrapped_url_read(void *src, void *dst, size_t *size)
     *size             = ret > 0 ? ret : 0;
     c->inner_io_error = ret < 0 ? ret : 0;
 
-    return c->inner_io_error;
+    return ret;
 }
 
 static int ring_write(RingBuffer *ring, URLContext *h, size_t size)
-- 
2.37.1



More information about the ffmpeg-devel mailing list