diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-19 21:23:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-08 13:15:42 +0200 |
commit | 2a6103a0820e99cf5ee1a368f3ae34838dc7e976 (patch) | |
tree | 982587af210721253f8eed4813fd208ba13aefcc | |
parent | 3fedd64d4b4afd55ac9cbfbf3e57984f97b08645 (diff) | |
download | ffmpeg-2a6103a0820e99cf5ee1a368f3ae34838dc7e976.tar.gz |
cmdutils: Filter dst/srcw/h
Dimensions / pixel formats for scaling must be set through the -s / pix_fmt options
or the scale / format filters. Otherwise there are mismatches between whet is
in/output to the scaler and for what the scaler is configured
Fixes Ticket4856
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a0af9fd95415293b965bb67e56a11f6429326db1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | cmdutils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c index b696008c87..3543edd0cb 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -563,6 +563,12 @@ int opt_default(void *optctx, const char *opt, const char *arg) struct SwsContext *sws = sws_alloc_context(); int ret = av_opt_set(sws, opt, arg, 0); sws_freeContext(sws); + if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") || + !strcmp(opt, "dstw") || !strcmp(opt, "dsth") || + !strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) { + av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n"); + return AVERROR(EINVAL); + } if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt); return ret; |