X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_scale.c;h=fd98abf7ea7b3ba4eac19bdd26293a4a38599867;hb=b3bf41cb75d434b2622433a96dcb617a58e9fca6;hp=a40b392c653e2a7edb9724737709e031d483f0a2;hpb=72773203a64af0a66a4e37fa03bf8744116f517a;p=ffmpeg diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index a40b392c653..fd98abf7ea7 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; }