From 9f61abc8111c7c43f49ca012e957a108b9cc7610 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 16 Jan 2016 17:53:43 +0100 Subject: lavf: allow custom IO for all files Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits. --- libavformat/internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libavformat/internal.h') diff --git a/libavformat/internal.h b/libavformat/internal.h index 17c45f6dab..ed9893033a 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -419,4 +419,10 @@ static inline int ff_rename(const char *oldpath, const char *newpath) return 0; } +/** + * A wrapper around AVFormatContext.io_close that should be used + * intead of calling the pointer directly. + */ +void ff_format_io_close(AVFormatContext *s, AVIOContext **pb); + #endif /* AVFORMAT_INTERNAL_H */ -- cgit v1.2.3