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/utils.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/utils.c')
-rw-r--r-- | libavformat/utils.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index f8846b7115..ef9ea93aaa 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -112,7 +112,11 @@ MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, data_codec) MAKE_ACCESSORS(AVFormatContext, format, int, metadata_header_padding) MAKE_ACCESSORS(AVFormatContext, format, void *, opaque) MAKE_ACCESSORS(AVFormatContext, format, av_format_control_message, control_message_cb) +#if FF_API_OLD_OPEN_CALLBACKS +FF_DISABLE_DEPRECATION_WARNINGS MAKE_ACCESSORS(AVFormatContext, format, AVOpenCallback, open_cb) +FF_ENABLE_DEPRECATION_WARNINGS +#endif int64_t av_stream_get_end_pts(const AVStream *st) { @@ -356,9 +360,7 @@ static int init_input(AVFormatContext *s, const char *filename, (!s->iformat && (s->iformat = av_probe_input_format2(&pd, 0, &score)))) return score; - if ((ret = ffio_open_whitelist(&s->pb, filename, AVIO_FLAG_READ | s->avio_flags, - &s->interrupt_callback, options, - s->protocol_whitelist)) < 0) + if ((ret = s->io_open(s, &s->pb, filename, AVIO_FLAG_READ | s->avio_flags, options)) < 0) return ret; if (s->iformat) @@ -4742,3 +4744,10 @@ int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt, } return ret; } + +void ff_format_io_close(AVFormatContext *s, AVIOContext **pb) +{ + if (*pb) + s->io_close(s, *pb); + *pb = NULL; +} |