summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2017-12-25 18:25:13 -0800
committerAman Gupta <aman@tmm1.net>2017-12-26 14:48:14 -0800
commitac19e63b184570c0ade4d3a8a785f64441d9cac8 (patch)
treec61bb2c865f84ec777a69959fdd66c0d4d3ca1b2 /libavformat
parent11f989945e1748fbe9b2a5abd68a25d3091acc5d (diff)
avformat/hls: respect http_persistent only for http playlist urls
Fixes a segfault when reading a live playlist (without end tag) from non-http url (like a file on disk). Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hls.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index c0bade0e84..2d46c2ac69 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -725,8 +725,9 @@ static int parse_playlist(HLSContext *c, const char *url,
struct variant_info variant_info;
char tmp_str[MAX_URL_SIZE];
struct segment *cur_init_section = NULL;
+ int is_http = av_strstart(url, "http", NULL);
- if (!in && c->http_persistent && c->playlist_pb) {
+ if (is_http && !in && c->http_persistent && c->playlist_pb) {
in = c->playlist_pb;
ret = open_url_keepalive(c->ctx, &c->playlist_pb, url);
if (ret == AVERROR_EXIT) {
@@ -760,7 +761,7 @@ static int parse_playlist(HLSContext *c, const char *url,
if (ret < 0)
return ret;
- if (c->http_persistent)
+ if (is_http && c->http_persistent)
c->playlist_pb = in;
else
close_in = 1;