forked from FFmpeg/FFmpeg
Merge commit '8c929098141ebc94ad3f303521c520bb3dc6d8f6'
* commit '8c929098141ebc94ad3f303521c520bb3dc6d8f6': hls: Check whether the AVIOContext contains a new redirected URL Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
9440e47067
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue