This reverts commit 9f9ed79d4cb40e5d9093899f8a79086ff23da844.
The hlsopts member was never set anywhere and always NULL, furthermore
the HLS demuxer needs to retrieve the proper options from the underlying
http protocol (cookies, user-agent, etc), so a dummy context won't help.
Instead, use the AVIOContext directly to access the options.
... | ... |
@@ -584,7 +584,7 @@ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url |
584 | 584 |
static void update_options(char **dest, const char *name, void *src) |
585 | 585 |
{ |
586 | 586 |
av_freep(dest); |
587 |
- av_opt_get(src, name, 0, (uint8_t**)dest); |
|
587 |
+ av_opt_get(src, name, AV_OPT_SEARCH_CHILDREN, (uint8_t**)dest); |
|
588 | 588 |
if (*dest && !strlen(*dest)) |
589 | 589 |
av_freep(dest); |
590 | 590 |
} |
... | ... |
@@ -614,8 +614,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, |
614 | 614 |
ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp); |
615 | 615 |
if (ret >= 0) { |
616 | 616 |
// update cookies on http response with setcookies. |
617 |
- AVIOInternal *internal = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque; |
|
618 |
- void *u = internal ? internal->hlsopts : NULL; |
|
617 |
+ void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb; |
|
619 | 618 |
update_options(&c->cookies, "cookies", u); |
620 | 619 |
av_dict_set(&opts, "cookies", c->cookies, 0); |
621 | 620 |
} |
... | ... |
@@ -1497,8 +1496,7 @@ static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url, |
1497 | 1497 |
|
1498 | 1498 |
static int hls_read_header(AVFormatContext *s) |
1499 | 1499 |
{ |
1500 |
- AVIOInternal *internal = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque; |
|
1501 |
- void *u = internal ? internal->hlsopts : NULL; |
|
1500 |
+ void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb; |
|
1502 | 1501 |
HLSContext *c = s->priv_data; |
1503 | 1502 |
int ret = 0, i, j, stream_offset = 0; |
1504 | 1503 |
|