This allows both the main playlist itself as well as the variant
playlists to handle redirects combined with relative URLs.
Signed-off-by: Martin Storsjö <martin@martin.st>
char line[1024];
const char *ptr;
int close_in = 0;
+ uint8_t *new_url = NULL;
if (!in) {
close_in = 1;
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;
var->last_load_time = av_gettime();
fail:
+ av_free(new_url);
if (close_in)
avio_close(in);
return ret;