diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2015-09-23 15:06:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-23 23:30:53 +0200 |
commit | 552faecf4b1c60ac7fe805653fa3189a15bc21f0 (patch) | |
tree | 16ef6d8292845e1d22dcd7130cb2e6b378c4ce64 /libavfilter/vf_scale.c | |
parent | 3441fef0f8bfcdfbad69b49b7fc526fcdb2185cd (diff) | |
download | ffmpeg-552faecf4b1c60ac7fe805653fa3189a15bc21f0.tar.gz |
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>
Diffstat (limited to 'libavfilter/vf_scale.c')
-rw-r--r-- | libavfilter/vf_scale.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index a40b392c65..fd98abf7ea 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -388,14 +388,14 @@ static int config_props(AVFilterLink *outlink) return ret; } } - /* Override YUV420P settings to have the correct (MPEG-2) chroma positions + /* Override YUV420P default settings to have the correct (MPEG-2) chroma positions * MPEG-2 chroma positions are used by convention * XXX: support other 4:2:0 pixel formats */ - if (inlink0->format == AV_PIX_FMT_YUV420P) { + if (inlink0->format == AV_PIX_FMT_YUV420P && scale->in_v_chr_pos == -513) { scale->in_v_chr_pos = (i == 0) ? 128 : (i == 1) ? 64 : 192; } - if (outlink->format == AV_PIX_FMT_YUV420P) { + if (outlink->format == AV_PIX_FMT_YUV420P && scale->out_v_chr_pos == -513) { scale->out_v_chr_pos = (i == 0) ? 128 : (i == 1) ? 64 : 192; } |