[FFmpeg-cvslog] cmdutils: Filter dst/srcw/h

Michael Niedermayer git at videolan.org
Sat Sep 19 21:46:35 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep 19 21:23:11 2015 +0200| [a0af9fd95415293b965bb67e56a11f6429326db1] | committer: Michael Niedermayer

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a0af9fd95415293b965bb67e56a11f6429326db1
---

 cmdutils.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cmdutils.c b/cmdutils.c
index b696008..3543edd 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;



More information about the ffmpeg-cvslog mailing list