diff mbox

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

Message ID 20170904032329.32670-1-lq@chinaffmpeg.org
State New
Headers show

Commit Message

Steven Liu Sept. 4, 2017, 3:23 a.m. UTC
fix ticket: #6490

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

Patch

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;
 }