aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-11-14 11:18:26 +0100
committerAnton Khirnov <anton@khirnov.net>2022-11-17 10:52:58 +0100
commit19e192eae6e52042f382272b1235ae6315e18cbc (patch)
tree07a7ecf1b4608b813f21b82c18dc2c0bf072e205
parent52380a055b358b8611d88fc02b3a477cac2e4f0c (diff)
downloadffmpeg-19e192eae6e52042f382272b1235ae6315e18cbc.tar.gz
fftools/ffmpeg_mux_init: do not call av{codec,format}_get_class() repeatedly
-rw-r--r--fftools/ffmpeg_mux_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 7ccaf9da78..6ed30eb498 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1727,6 +1727,8 @@ static int set_dispositions(OutputFile *of, AVFormatContext *ctx)
static void validate_enc_avopt(const Muxer *mux, const AVDictionary *codec_avopt)
{
+ const AVClass *class = avcodec_get_class();
+ const AVClass *fclass = avformat_get_class();
const OutputFile *of = &mux->of;
AVDictionary *unused_opts;
@@ -1742,10 +1744,8 @@ static void validate_enc_avopt(const Muxer *mux, const AVDictionary *codec_avopt
e = NULL;
while ((e = av_dict_get(unused_opts, "", e, AV_DICT_IGNORE_SUFFIX))) {
- const AVClass *class = avcodec_get_class();
const AVOption *option = av_opt_find(&class, e->key, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
- const AVClass *fclass = avformat_get_class();
const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
if (!option || foption)