Commit 9440e470 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '8c929098'

* commit '8c929098':
  hls: Check whether the AVIOContext contains a new redirected URL
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 15b2ec57 8c929098
......@@ -216,6 +216,7 @@ static int parse_playlist(HLSContext *c, const char *url,
char line[MAX_URL_SIZE];
const char *ptr;
int close_in = 0;
uint8_t *new_url = NULL;
if (!in) {
AVDictionary *opts = NULL;
......@@ -235,6 +236,9 @@ static int parse_playlist(HLSContext *c, const char *url,
return ret;
}
if (av_opt_get(in, "location", AV_OPT_SEARCH_CHILDREN, &new_url) >= 0)
url = new_url;
read_chomp_line(in, line, sizeof(line));
if (strcmp(line, "#EXTM3U")) {
ret = AVERROR_INVALIDDATA;
......@@ -335,6 +339,7 @@ static int parse_playlist(HLSContext *c, const char *url,
var->last_load_time = av_gettime();
fail:
av_free(new_url);
if (close_in)
avio_close(in);
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment