diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-29 20:09:32 +0000 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-29 20:10:11 +0000 |
commit | 9f9ed79d4cb40e5d9093899f8a79086ff23da844 (patch) | |
tree | 53ef3c3ee7c2abb053fc9389f1fdf269c7ce5fdc /libavformat | |
parent | 3acbb91d13591944552576b6cfbf9eafc76ebdea (diff) | |
download | ffmpeg-9f9ed79d4cb40e5d9093899f8a79086ff23da844.tar.gz |
hls: Add and use a memebr of AVIOInternal rather than abuse opaque
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avio_internal.h | 5 | ||||
-rw-r--r-- | libavformat/aviobuf.c | 4 | ||||
-rw-r--r-- | libavformat/hls.c | 6 |
3 files changed, 9 insertions, 6 deletions
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h index 54bdfa1cf9..1e2a18e161 100644 --- a/libavformat/avio_internal.h +++ b/libavformat/avio_internal.h @@ -24,6 +24,11 @@ #include "libavutil/log.h" +typedef struct AVIOInternal { + URLContext *h; + void *hlsopts; +} AVIOInternal; + extern const AVClass ff_avio_class; int ffio_init_context(AVIOContext *s, diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 6fc8745e46..e45afd1cef 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -42,10 +42,6 @@ */ #define SHORT_SEEK_THRESHOLD 4096 -typedef struct AVIOInternal { - URLContext *h; -} AVIOInternal; - static void *ff_avio_child_next(void *obj, void *prev) { AVIOContext *s = obj; diff --git a/libavformat/hls.c b/libavformat/hls.c index aa5d60e647..171544501b 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -614,7 +614,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp); if (ret >= 0) { // update cookies on http response with setcookies. - void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque; + AVIOInternal *internal = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque; + void *u = internal ? internal->hlsopts : NULL; update_options(&c->cookies, "cookies", u); av_dict_set(&opts, "cookies", c->cookies, 0); } @@ -1496,7 +1497,8 @@ static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url, static int hls_read_header(AVFormatContext *s) { - void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque; + AVIOInternal *internal = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque; + void *u = internal ? internal->hlsopts : NULL; HLSContext *c = s->priv_data; int ret = 0, i, j, stream_offset = 0; |