Browse code

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 <loudmax@yahoo.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Thomas Mundt authored on 2015/12/31 08:01:21
Showing 1 changed files
... ...
@@ -567,6 +567,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
567 567
             sws_setColorspaceDetails(scale->isws[1], inv_table, in_full,
568 568
                                      table, out_full,
569 569
                                      brightness, contrast, saturation);
570
+
571
+        av_frame_set_color_range(out, out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG);
570 572
     }
571 573
 
572 574
     av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,