[FFmpeg-devel] [PATCH 09/18] avformat/hls: always return EOF for unneeded playlist streams

Anssi Hannula anssi.hannula at iki.fi
Mon Dec 30 12:14:23 CET 2013


Even if we returned AVERROR_EOF previously due to playlist no longer
being needed, we may still be called again, and we do not want to
trigger a segment download in that case.

Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>
---
 libavformat/hls.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 8927ba1..2a337fb 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -646,6 +646,9 @@ static int read_data(void *opaque, uint8_t *buf, int buf_size)
     HLSContext *c = v->parent->priv_data;
     int ret, i;
 
+    if (!v->needed)
+        return AVERROR_EOF;
+
 restart:
     if (!v->input) {
         /* If this is a live stream and the reload interval has elapsed since
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list