diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-04-18 10:36:38 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-04-24 16:56:06 +0200 |
commit | ecb44ca8777c0323c4ed00f64465a4072188c959 (patch) | |
tree | 4e188fabb4aba3a8f5ccc3542365ee03678a7eee /fftools | |
parent | 84e1e0fa7361579affc24030d1ae7cdc22f112c1 (diff) | |
download | ffmpeg-ecb44ca8777c0323c4ed00f64465a4072188c959.tar.gz |
fftools/ffmpeg_mux_init: drop OutputStream.filters[_script]
They are not needed outside of ost_get_filters(), so make them stack
variables there.
Diffstat (limited to 'fftools')
-rw-r--r-- | fftools/ffmpeg.h | 2 | ||||
-rw-r--r-- | fftools/ffmpeg_mux_init.c | 28 |
2 files changed, 15 insertions, 15 deletions
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 72020c8f3a..c9d499efdd 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -639,8 +639,6 @@ typedef struct OutputStream { OutputFilter *filter; char *avfilter; - char *filters; ///< filtergraph associated to the -filter option - char *filters_script; ///< filtergraph script associated to the -filter_script option AVDictionary *encoder_opts; AVDictionary *sws_dict; diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index c82556a706..da3dccd6d7 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -423,43 +423,45 @@ static MuxStream *mux_stream_alloc(Muxer *mux, enum AVMediaType type) static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc, OutputStream *ost) { - MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, ost->st); - MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, ost->st); + const char *filters = NULL, *filters_script = NULL; + + MATCH_PER_STREAM_OPT(filter_scripts, str, filters_script, oc, ost->st); + MATCH_PER_STREAM_OPT(filters, str, filters, oc, ost->st); if (!ost->enc) { - if (ost->filters_script || ost->filters) { + if (filters_script || filters) { av_log(ost, AV_LOG_ERROR, "%s '%s' was specified, but codec copy was selected. " "Filtering and streamcopy cannot be used together.\n", - ost->filters ? "Filtergraph" : "Filtergraph script", - ost->filters ? ost->filters : ost->filters_script); + filters ? "Filtergraph" : "Filtergraph script", + filters ? filters : filters_script); return AVERROR(ENOSYS); } return 0; } if (!ost->ist) { - if (ost->filters_script || ost->filters) { + if (filters_script || filters) { av_log(ost, AV_LOG_ERROR, "%s '%s' was specified for a stream fed from a complex " "filtergraph. Simple and complex filtering cannot be used " "together for the same stream.\n", - ost->filters ? "Filtergraph" : "Filtergraph script", - ost->filters ? ost->filters : ost->filters_script); + filters ? "Filtergraph" : "Filtergraph script", + filters ? filters : filters_script); return AVERROR(EINVAL); } return 0; } - if (ost->filters_script && ost->filters) { + if (filters_script && filters) { av_log(ost, AV_LOG_ERROR, "Both -filter and -filter_script set\n"); exit_program(1); } - if (ost->filters_script) - ost->avfilter = file_read(ost->filters_script); - else if (ost->filters) - ost->avfilter = av_strdup(ost->filters); + if (filters_script) + ost->avfilter = file_read(filters_script); + else if (filters) + ost->avfilter = av_strdup(filters); else ost->avfilter = av_strdup(ost->type == AVMEDIA_TYPE_VIDEO ? "null" : "anull"); return ost->avfilter ? 0 : AVERROR(ENOMEM); |