diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-10 14:40:32 +0000 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-10 14:42:41 +0000 |
commit | bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce (patch) | |
tree | 7011642746984633573c9a2d993d58dfd12ee44b /libavformat/hls.c | |
parent | d94b11a721385aa406187da8f49380f29be0fa7e (diff) | |
parent | 9f61abc8111c7c43f49ca012e957a108b9cc7610 (diff) | |
download | ffmpeg-bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce.tar.gz |
Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'
This also deprecates our old duplicated callbacks.
* commit '9f61abc8111c7c43f49ca012e957a108b9cc7610':
lavf: allow custom IO for all files
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r-- | libavformat/hls.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index e23eaf1657..fc1ff38e05 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -180,7 +180,7 @@ struct variant { typedef struct HLSContext { AVClass *class; - AVFormatContext *avfmt; + AVFormatContext *ctx; int n_variants; struct variant **variants; int n_playlists; @@ -635,7 +635,7 @@ static int open_url(HLSContext *c, URLContext **uc, const char *url, AVDictionar av_dict_copy(&tmp, c->avio_opts, 0); av_dict_copy(&tmp, opts, 0); - ret = ffurl_open_whitelist(uc, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp, c->avfmt->protocol_whitelist); + ret = ffurl_open_whitelist(uc, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp, c->ctx->protocol_whitelist); if( ret >= 0) { // update cookies on http response with setcookies. URLContext *u = *uc; @@ -680,8 +680,7 @@ static int parse_playlist(HLSContext *c, const char *url, av_dict_set(&opts, "headers", c->headers, 0); av_dict_set(&opts, "http_proxy", c->http_proxy, 0); - ret = ffio_open_whitelist(&in, url, AVIO_FLAG_READ, - c->interrupt_callback, &opts, c->avfmt->protocol_whitelist); + ret = c->ctx->io_open(c->ctx, &in, url, AVIO_FLAG_READ, &opts); av_dict_free(&opts); if (ret < 0) return ret; @@ -849,7 +848,7 @@ static int parse_playlist(HLSContext *c, const char *url, fail: av_free(new_url); if (close_in) - avio_close(in); + ff_format_io_close(c->ctx, &in); return ret; } @@ -1518,7 +1517,7 @@ static int hls_read_header(AVFormatContext *s) HLSContext *c = s->priv_data; int ret = 0, i, j, stream_offset = 0; - c->avfmt = s; + c->ctx = s; c->interrupt_callback = &s->interrupt_callback; c->strict_std_compliance = s->strict_std_compliance; |