diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-22 21:07:23 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-22 21:08:53 +0400 |
commit | 9440e4706793e71527fc1e0355e53ace0e227213 (patch) | |
tree | 39837e0d9bbbe8489f50510f9e5f47f45e3cefc8 /libavformat/hls.c | |
parent | 15b2ec57ccaee49e8ec6de93d0ad7055da282e4d (diff) | |
parent | 8c929098141ebc94ad3f303521c520bb3dc6d8f6 (diff) |
Merge commit '8c929098141ebc94ad3f303521c520bb3dc6d8f6'
* commit '8c929098141ebc94ad3f303521c520bb3dc6d8f6':
hls: Check whether the AVIOContext contains a new redirected URL
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r-- | libavformat/hls.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index b0f28f6289..65cd12112d 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -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; |