If we meet timeout when reading network resource, avio_read will set
[eof_reached] to 1. And this prevent caller to retry since avio_read
do nothing and just return if eof_reached == 1.

Signed-off-by: Wang Chuan <ouchu...@outlook.com>
---
 libavformat/aviobuf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 29d4bd7510..38cb21debf 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -580,8 +580,9 @@ static void fill_buffer(AVIOContext *s)
            be done without rereading data */
         s->eof_reached = 1;
     } else if (len < 0) {
-        s->eof_reached = 1;
-        s->error= len;
+        s->error = len;
+        if (s->error != AVERROR(ETIMEDOUT))
+            s->eof_reached = 1;
     } else {
         s->pos += len;
         s->buf_ptr = dst;
--
2.29.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to