diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-10-18 12:45:42 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-10-25 11:12:22 +0200 |
commit | 0d821edb40d27848304a7354b1c64c2e30e00e7d (patch) | |
tree | 6f8a7b5766dd51ee6fcb878a9ca3406e3a528d16 /fftools | |
parent | 69da53ade99d5ae67a49f49bc052117ce0a20336 (diff) | |
download | ffmpeg-0d821edb40d27848304a7354b1c64c2e30e00e7d.tar.gz |
fftools/ffmpeg_mux_init: stop modifying OptionsContext.*_disable
The current code will override the *_disable fields (set by -vn/-an
options) when creating output streams for unlabeled complex filtergraph
outputs, in order to disable automatic mapping for the corresponding
media type.
However, this will apply not only to automatic mappings, but to manual
ones as well, which should not happen. Avoid this by adding local
variables that are used only for automatic mappings.
Diffstat (limited to 'fftools')
-rw-r--r-- | fftools/ffmpeg_mux_init.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 0f61fb2e4b..f40622750f 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1064,6 +1064,11 @@ loop_end: static void create_streams(Muxer *mux, OptionsContext *o) { + int auto_disable_v = o->video_disable; + int auto_disable_a = o->audio_disable; + int auto_disable_s = o->subtitle_disable; + int auto_disable_d = o->data_disable; + /* create streams for all unlabeled output pads */ for (int i = 0; i < nb_filtergraphs; i++) { FilterGraph *fg = filtergraphs[i]; @@ -1074,9 +1079,9 @@ static void create_streams(Muxer *mux, OptionsContext *o) continue; switch (ofilter->type) { - case AVMEDIA_TYPE_VIDEO: o->video_disable = 1; break; - case AVMEDIA_TYPE_AUDIO: o->audio_disable = 1; break; - case AVMEDIA_TYPE_SUBTITLE: o->subtitle_disable = 1; break; + case AVMEDIA_TYPE_VIDEO: auto_disable_v = 1; break; + case AVMEDIA_TYPE_AUDIO: auto_disable_a = 1; break; + case AVMEDIA_TYPE_SUBTITLE: auto_disable_s = 1; break; } init_output_filter(ofilter, o, mux); } @@ -1084,13 +1089,13 @@ static void create_streams(Muxer *mux, OptionsContext *o) if (!o->nb_stream_maps) { /* pick the "best" stream of each type */ - if (!o->video_disable) + if (!auto_disable_v) map_auto_video(mux, o); - if (!o->audio_disable) + if (!auto_disable_a) map_auto_audio(mux, o); - if (!o->subtitle_disable) + if (!auto_disable_s) map_auto_subtitle(mux, o); - if (!o->data_disable) + if (!auto_disable_d) map_auto_data(mux, o); } else { for (int i = 0; i < o->nb_stream_maps; i++) |