Browse code

vf_scale: conditionally override chroma position

For yuv420p, the chroma position is unilaterally overriden, even
if ffmpeg's command-line explicitly set it. To fix this, override
only if the value is the default one.

Regression since 1515bfb3.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Christophe Gisquet authored on 2015/09/23 22:06:01
Showing 1 changed files
... ...
@@ -388,14 +388,14 @@ static int config_props(AVFilterLink *outlink)
388 388
                         return ret;
389 389
                 }
390 390
             }
391
-            /* Override YUV420P settings to have the correct (MPEG-2) chroma positions
391
+            /* Override YUV420P default settings to have the correct (MPEG-2) chroma positions
392 392
              * MPEG-2 chroma positions are used by convention
393 393
              * XXX: support other 4:2:0 pixel formats */
394
-            if (inlink0->format == AV_PIX_FMT_YUV420P) {
394
+            if (inlink0->format == AV_PIX_FMT_YUV420P && scale->in_v_chr_pos == -513) {
395 395
                 scale->in_v_chr_pos = (i == 0) ? 128 : (i == 1) ? 64 : 192;
396 396
             }
397 397
 
398
-            if (outlink->format == AV_PIX_FMT_YUV420P) {
398
+            if (outlink->format == AV_PIX_FMT_YUV420P && scale->out_v_chr_pos == -513) {
399 399
                 scale->out_v_chr_pos = (i == 0) ? 128 : (i == 1) ? 64 : 192;
400 400
             }
401 401