Browse code

lavfi/scale: Pass src_range and dst_range to libswscale.

Fixes ticket #4812.

Carl Eugen Hoyos authored on 2015/09/01 16:17:26
Showing 2 changed files
... ...
@@ -31,7 +31,7 @@
31 31
 
32 32
 #define LIBAVFILTER_VERSION_MAJOR  5
33 33
 #define LIBAVFILTER_VERSION_MINOR  40
34
-#define LIBAVFILTER_VERSION_MICRO 100
34
+#define LIBAVFILTER_VERSION_MICRO 101
35 35
 
36 36
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
37 37
                                                LIBAVFILTER_VERSION_MINOR, \
... ...
@@ -374,6 +374,12 @@ static int config_props(AVFilterLink *outlink)
374 374
             av_opt_set_int(*s, "sws_flags", scale->flags, 0);
375 375
             av_opt_set_int(*s, "param0", scale->param[0], 0);
376 376
             av_opt_set_int(*s, "param1", scale->param[1], 0);
377
+            if (scale->in_range != AVCOL_RANGE_UNSPECIFIED)
378
+                av_opt_set_int(*s, "src_range",
379
+                               scale->in_range == AVCOL_RANGE_JPEG, 0);
380
+            if (scale->out_range != AVCOL_RANGE_UNSPECIFIED)
381
+                av_opt_set_int(*s, "dst_range",
382
+                               scale->out_range == AVCOL_RANGE_JPEG, 0);
377 383
 
378 384
             if (scale->opts) {
379 385
                 AVDictionaryEntry *e = NULL;