diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-12-13 15:50:36 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-07-23 11:53:19 +0200 |
commit | 52fee96ae9ed34041718d238223a207e2c018dae (patch) | |
tree | 0c3f5aea75d600e320f2dde4406a1eb21f1892ca /fftools/ffmpeg_mux.c | |
parent | ec00b005f9fa0942954bfc865f3b9606aa957a3c (diff) |
fftools/ffmpeg: move output file opts into private context
It is private to the muxer, no reason to access it from outside.
Diffstat (limited to 'fftools/ffmpeg_mux.c')
-rw-r--r-- | fftools/ffmpeg_mux.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index ed091a3d2d..0fd7888d4f 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -46,6 +46,8 @@ typedef struct MuxStream { struct Muxer { MuxStream *streams; + AVDictionary *opts; + /* filesize limit expressed in bytes */ int64_t limit_filesize; int64_t final_filesize; @@ -281,7 +283,7 @@ int of_check_init(OutputFile *of) return 0; } - ret = avformat_write_header(of->ctx, &of->opts); + ret = avformat_write_header(of->ctx, &of->mux->opts); if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Could not write header for output file #%d " @@ -374,6 +376,7 @@ static void mux_free(Muxer **pmux, int nb_streams) av_fifo_freep2(&ms->muxing_queue); } av_freep(&mux->streams); + av_dict_free(&mux->opts); av_freep(pmux); } @@ -393,12 +396,11 @@ void of_close(OutputFile **pof) if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE)) avio_closep(&s->pb); avformat_free_context(s); - av_dict_free(&of->opts); av_freep(pof); } -int of_muxer_init(OutputFile *of, int64_t limit_filesize) +int of_muxer_init(OutputFile *of, AVDictionary *opts, int64_t limit_filesize) { Muxer *mux = av_mallocz(sizeof(*mux)); int ret = 0; @@ -424,6 +426,7 @@ int of_muxer_init(OutputFile *of, int64_t limit_filesize) } mux->limit_filesize = limit_filesize; + mux->opts = opts; if (strcmp(of->format->name, "rtp")) want_sdp = 0; |