[FFmpeg-devel] [PATCH] avformat/hls: return eof when avio_read data at the file end

Steven Liu lq at chinaffmpeg.org
Mon Sep 4 06:23:29 EEST 2017


fix ticket: #6490

Signed-off-by: Steven Liu <lq at onvideo.cn>
---
 libavformat/hls.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 0995345bbf..7572fe6e06 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -898,6 +898,10 @@ static int read_from_url(struct playlist *pls, struct segment *seg,
     if (ret > 0)
         pls->cur_seg_offset += ret;
 
+    if (ret > 0 && ret < buf_size) {
+        ret = AVERROR_EOF;
+    }
+
     return ret;
 }
 
-- 
2.11.0 (Apple Git-81)





More information about the ffmpeg-devel mailing list