1
From be70574c03f97c83e5701118d68a07e91b81c3d6 Mon Sep 17 00:00:00 2001
2
From: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3
Date: Tue, 22 Sep 2015 13:40:20 +0200
4
Subject: [PATCH] hls: only seek if there is an offset
6
If there is no #EXT-X-BYTERANGE specified, there is no need to seek.
7
Seeking fails anyway for rtmp, because this protocol does not support
10
This fixes CNN.m3u from trac ticket 4797 (i.e. Debian bug #798189).
12
libavformat/hls.c | 2 +-
13
1 file changed, 1 insertion(+), 1 deletion(-)
15
diff --git a/libavformat/hls.c b/libavformat/hls.c
16
index c16c770..896d36e 100644
17
--- a/libavformat/hls.c
18
+++ b/libavformat/hls.c
19
@@ -1047,7 +1047,7 @@ static int open_input(HLSContext *c, struct playlist *pls)
20
/* Seek to the requested position. If this was a HTTP request, the offset
21
* should already be where want it to, but this allows e.g. local testing
22
* without a HTTP server. */
23
- if (ret == 0 && seg->key_type == KEY_NONE) {
24
+ if (ret == 0 && seg->key_type == KEY_NONE && seg->url_offset) {
25
int seekret = ffurl_seek(pls->input, seg->url_offset, SEEK_SET);
27
av_log(pls->parent, AV_LOG_ERROR, "Unable to seek to offset %"PRId64" of HLS segment '%s'\n", seg->url_offset, seg->url);