You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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>
This commit is contained in:
@@ -725,8 +725,9 @@ static int parse_playlist(HLSContext *c, const char *url,
|
|||||||
struct variant_info variant_info;
|
struct variant_info variant_info;
|
||||||
char tmp_str[MAX_URL_SIZE];
|
char tmp_str[MAX_URL_SIZE];
|
||||||
struct segment *cur_init_section = NULL;
|
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;
|
in = c->playlist_pb;
|
||||||
ret = open_url_keepalive(c->ctx, &c->playlist_pb, url);
|
ret = open_url_keepalive(c->ctx, &c->playlist_pb, url);
|
||||||
if (ret == AVERROR_EXIT) {
|
if (ret == AVERROR_EXIT) {
|
||||||
@@ -760,7 +761,7 @@ static int parse_playlist(HLSContext *c, const char *url,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (c->http_persistent)
|
if (is_http && c->http_persistent)
|
||||||
c->playlist_pb = in;
|
c->playlist_pb = in;
|
||||||
else
|
else
|
||||||
close_in = 1;
|
close_in = 1;
|
||||||
|
Reference in New Issue
Block a user