1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

fftools/ffmpeg_mux_init: drop OutputStream.filters[_script]

They are not needed outside of ost_get_filters(), so make them stack
variables there.
This commit is contained in:
Anton Khirnov
2023-04-18 10:36:38 +02:00
parent 84e1e0fa73
commit ecb44ca877
2 changed files with 15 additions and 15 deletions

View File

@@ -639,8 +639,6 @@ typedef struct OutputStream {
OutputFilter *filter; OutputFilter *filter;
char *avfilter; 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 *encoder_opts;
AVDictionary *sws_dict; AVDictionary *sws_dict;

View File

@@ -423,43 +423,45 @@ static MuxStream *mux_stream_alloc(Muxer *mux, enum AVMediaType type)
static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc, static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc,
OutputStream *ost) OutputStream *ost)
{ {
MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, ost->st); const char *filters = NULL, *filters_script = NULL;
MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, ost->st);
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->enc) {
if (ost->filters_script || ost->filters) { if (filters_script || filters) {
av_log(ost, AV_LOG_ERROR, av_log(ost, AV_LOG_ERROR,
"%s '%s' was specified, but codec copy was selected. " "%s '%s' was specified, but codec copy was selected. "
"Filtering and streamcopy cannot be used together.\n", "Filtering and streamcopy cannot be used together.\n",
ost->filters ? "Filtergraph" : "Filtergraph script", filters ? "Filtergraph" : "Filtergraph script",
ost->filters ? ost->filters : ost->filters_script); filters ? filters : filters_script);
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
} }
return 0; return 0;
} }
if (!ost->ist) { if (!ost->ist) {
if (ost->filters_script || ost->filters) { if (filters_script || filters) {
av_log(ost, AV_LOG_ERROR, av_log(ost, AV_LOG_ERROR,
"%s '%s' was specified for a stream fed from a complex " "%s '%s' was specified for a stream fed from a complex "
"filtergraph. Simple and complex filtering cannot be used " "filtergraph. Simple and complex filtering cannot be used "
"together for the same stream.\n", "together for the same stream.\n",
ost->filters ? "Filtergraph" : "Filtergraph script", filters ? "Filtergraph" : "Filtergraph script",
ost->filters ? ost->filters : ost->filters_script); filters ? filters : filters_script);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
return 0; 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"); av_log(ost, AV_LOG_ERROR, "Both -filter and -filter_script set\n");
exit_program(1); exit_program(1);
} }
if (ost->filters_script) if (filters_script)
ost->avfilter = file_read(ost->filters_script); ost->avfilter = file_read(filters_script);
else if (ost->filters) else if (filters)
ost->avfilter = av_strdup(ost->filters); ost->avfilter = av_strdup(filters);
else else
ost->avfilter = av_strdup(ost->type == AVMEDIA_TYPE_VIDEO ? "null" : "anull"); ost->avfilter = av_strdup(ost->type == AVMEDIA_TYPE_VIDEO ? "null" : "anull");
return ost->avfilter ? 0 : AVERROR(ENOMEM); return ost->avfilter ? 0 : AVERROR(ENOMEM);