summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-09-22 13:40:20 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-09-22 21:00:01 +0200
commitf9f0b4c08e7dc2c178ede137af4f64ca84ab2deb (patch)
tree0b602fa2a90cdf3276f9040fd7b7755951b57517 /libavformat/hls.c
parente859a3c864d57afaed46b99c3eb744b62ab36de4 (diff)
hls: only seek if there is an offset
If there is no #EXT-X-BYTERANGE specified, there is no need to seek. Seeking fails anyway for rtmp, because this protocol does not support url_seek. This fixes CNN.m3u from trac ticket 4797 (i.e. Debian bug #798189). Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r--libavformat/hls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 6df95d4041..adaa33aa10 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1043,7 +1043,7 @@ static int open_input(HLSContext *c, struct playlist *pls)
/* Seek to the requested position. If this was a HTTP request, the offset
* should already be where want it to, but this allows e.g. local testing
* without a HTTP server. */
- if (ret == 0 && seg->key_type == KEY_NONE) {
+ if (ret == 0 && seg->key_type == KEY_NONE && seg->url_offset) {
int seekret = ffurl_seek(pls->input, seg->url_offset, SEEK_SET);
if (seekret < 0) {
av_log(pls->parent, AV_LOG_ERROR, "Unable to seek to offset %"PRId64" of HLS segment '%s'\n", seg->url_offset, seg->url);