summaryrefslogtreecommitdiff
path: root/ffmpeg_opt.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-11-04 10:05:24 +0100
committerStefano Sabatini <stefasab@gmail.com>2013-11-09 19:05:35 +0100
commitf591ba60ff4b873b26e3b5c428c5562ffb7e8d41 (patch)
tree69928fc4164c356798575fc90076fe62c1b02a4c /ffmpeg_opt.c
parent0f8bdfe3e807276d2a6f1799a7cc111cf78434bd (diff)
ffmpeg: generate more specific error message in case of inconsistent filtering options
In particular, distinguish if the option was -filter or -filter_script. Suggested-by: Nicolas George
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r--ffmpeg_opt.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 9b3d41b64b..2cdc56dacc 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1172,13 +1172,11 @@ static void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc,
{
if (ost->filters_script || ost->filters) {
av_log(NULL, AV_LOG_ERROR,
- "Filtergraph '%s' or filter_script '%s' was defined for %s output stream "
- "%d:%d but codec copy was selected.\n"
+ "%s '%s' was defined for %s output stream %d:%d but codec copy was selected.\n"
"Filtering and streamcopy cannot be used together.\n",
- (char *)av_x_if_null(ost->filters, "(none)"),
- (char *)av_x_if_null(ost->filters_script, "(none)"),
- av_get_media_type_string(type),
- ost->file_index, ost->index);
+ ost->filters ? "Filtergraph" : "Filtergraph script",
+ ost->filters ? ost->filters : ost->filters_script,
+ av_get_media_type_string(type), ost->file_index, ost->index);
exit_program(1);
}
}
@@ -1573,14 +1571,15 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
}
if (ost->avfilter && (ost->filters || ost->filters_script)) {
- av_log(NULL, AV_LOG_ERROR,
- "Filter graph '%s' or filter script '%s' was specified through the -filter/-filter_script/-vf/-af option "
- "for output stream %d:%d, which is fed from a complex filtergraph.\n"
- "-filter/-filter_script and -filter_complex cannot be used together for the same stream.\n",
- (char *)av_x_if_null(ost->filters, "(none)"),
- (char *)av_x_if_null(ost->filters_script, "(none)"),
- ost->file_index, ost->index);
- exit_program(1);
+ const char *opt = ost->filters ? "-vf/-af/-filter" : "-filter_script";
+ av_log(NULL, AV_LOG_ERROR,
+ "%s '%s' was specified through the %s option "
+ "for output stream %d:%d, which is fed from a complex filtergraph.\n"
+ "%s and -filter_complex cannot be used together for the same stream.\n",
+ ost->filters ? "Filtergraph" : "Filtergraph script",
+ ost->filters ? ost->filters : ost->filters_script,
+ opt, ost->file_index, ost->index, opt);
+ exit_program(1);
}
if (configure_output_filter(ofilter->graph, ofilter, ofilter->out_tmp) < 0) {