Merge commit '8c929098141ebc94ad3f303521c520bb3dc6d8f6'

* commit '8c929098141ebc94ad3f303521c520bb3dc6d8f6':
  hls: Check whether the AVIOContext contains a new redirected URL

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/49/head
Michael Niedermayer 11 years ago
commit 9440e47067
  1. 5
      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;

Loading…
Cancel
Save