From 2f6d3459d9085472ddab243eaa1bf47aed3f130f Mon Sep 17 00:00:00 2001 From: Thomas Mundt Date: Thu, 31 Dec 2015 00:01:21 +0100 Subject: [PATCH] avfilter/vf_scale: set proper out frame color range Prevents that following scalers in the filter chain will do unintentional color range conversions. Fixes Ticket #5096 Signed-off-by: Thomas Mundt Signed-off-by: Michael Niedermayer (cherry picked from commit 73ce8162f3499cf0e86d1d80dea53324bd62bcb3) Signed-off-by: Michael Niedermayer --- libavfilter/vf_scale.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 2a3d00808d..d5cd2dcc20 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -526,6 +526,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) sws_setColorspaceDetails(scale->isws[1], inv_table, in_full, table, out_full, brightness, contrast, saturation); + + av_frame_set_color_range(out, out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG); } av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,