diff options
author | Jan Sebechlebsky <sebechlebskyjan@gmail.com> | 2016-07-04 16:45:13 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2016-07-16 01:29:44 +0200 |
commit | 6a3515a5a49e985b0f2ce430c9cae9e21dd6d7c2 (patch) | |
tree | aeb66222c9e9d967d47be3fc7ad6eafbfd7040d6 /libavformat/utils.c | |
parent | e144b86fa4c7e178f2a7a9436ac2a89a82b58b09 (diff) | |
download | ffmpeg-6a3515a5a49e985b0f2ce430c9cae9e21dd6d7c2.tar.gz |
avformat/utils: Add ff_format_output_open() function
Add ff_format_output_open utility function to wrap
io_open callback of AVFormatContext structure.
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index f2b0e6e1e5..e5a99ff4ad 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -5169,6 +5169,16 @@ int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt, FF_ENABLE_DEPRECATION_WARNINGS #endif +int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options) +{ + if (!s->oformat) + return AVERROR(EINVAL); + + if (!(s->oformat->flags & AVFMT_NOFILE)) + return s->io_open(s, &s->pb, url, AVIO_FLAG_WRITE, options); + return 0; +} + void ff_format_io_close(AVFormatContext *s, AVIOContext **pb) { if (*pb) |