diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-02-20 08:02:16 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 14:12:43 +0100 |
commit | 9d3009c6c4b9b6734f07df7c88f6a42ded6cdf38 (patch) | |
tree | a8cda259c49d4db73beafedcd025c7c4c0ab46c2 /cmdutils.c | |
parent | e460aa3282962aa3e89f19e207ec13b501187949 (diff) | |
download | ffmpeg-9d3009c6c4b9b6734f07df7c88f6a42ded6cdf38.tar.gz |
avconv: print an error on applying options of the wrong type.
I.e. input options to output files or vice versa.
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c index 4655681e4a..ff4b0270c3 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -351,6 +351,16 @@ int parse_optgroup(void *optctx, OptionGroup *g) for (i = 0; i < g->nb_opts; i++) { Option *o = &g->opts[i]; + if (g->group_def->flags && + !(g->group_def->flags & o->opt->flags)) { + av_log(NULL, AV_LOG_ERROR, "Option %s (%s) cannot be applied to " + "%s %s -- you are trying to apply an input option to an " + "output file or vice versa. Move this option before the " + "file it belongs to.\n", o->key, o->opt->help, + g->group_def->name, g->arg); + return AVERROR(EINVAL); + } + av_log(NULL, AV_LOG_DEBUG, "Applying option %s (%s) with argument %s.\n", o->key, o->opt->help, o->val); |