Commit 9f9ed79d authored by Derek Buitenhuis's avatar Derek Buitenhuis

hls: Add and use a memebr of AVIOInternal rather than abuse opaque

Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parent 3acbb91d
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
#include "libavutil/log.h" #include "libavutil/log.h"
typedef struct AVIOInternal {
URLContext *h;
void *hlsopts;
} AVIOInternal;
extern const AVClass ff_avio_class; extern const AVClass ff_avio_class;
int ffio_init_context(AVIOContext *s, int ffio_init_context(AVIOContext *s,
......
...@@ -42,10 +42,6 @@ ...@@ -42,10 +42,6 @@
*/ */
#define SHORT_SEEK_THRESHOLD 4096 #define SHORT_SEEK_THRESHOLD 4096
typedef struct AVIOInternal {
URLContext *h;
} AVIOInternal;
static void *ff_avio_child_next(void *obj, void *prev) static void *ff_avio_child_next(void *obj, void *prev)
{ {
AVIOContext *s = obj; AVIOContext *s = obj;
......
...@@ -614,7 +614,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, ...@@ -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); ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
if (ret >= 0) { if (ret >= 0) {
// update cookies on http response with setcookies. // 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); update_options(&c->cookies, "cookies", u);
av_dict_set(&opts, "cookies", c->cookies, 0); av_dict_set(&opts, "cookies", c->cookies, 0);
} }
...@@ -1496,7 +1497,8 @@ static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url, ...@@ -1496,7 +1497,8 @@ static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url,
static int hls_read_header(AVFormatContext *s) 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; HLSContext *c = s->priv_data;
int ret = 0, i, j, stream_offset = 0; int ret = 0, i, j, stream_offset = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment