[FFmpeg-devel,08/24] fftools/ffplay: support only limited color range

Submitted by Paul B Mahol on May 1, 2018, 7:39 p.m.

Details

Message ID 20180501194013.9552-8-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol May 1, 2018, 7:39 p.m.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 fftools/ffplay.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index dcca9c26d8..86bda1a2c4 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -1822,6 +1822,7 @@  fail:
 static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters, AVFrame *frame)
 {
     enum AVPixelFormat pix_fmts[FF_ARRAY_ELEMS(sdl_texture_format_map)];
+    enum AVColorRange color_ranges[2] = { AVCOL_RANGE_MPEG, AVCOL_RANGE_UNSPECIFIED };
     char sws_flags_str[512] = "";
     char buffersrc_args[256];
     int ret;
@@ -1876,7 +1877,10 @@  static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
     if ((ret = av_opt_set_int_list(filt_out, "pix_fmts", pix_fmts,  AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN)) < 0)
         goto fail;
 
-    last_filter = filt_out;
+    if ((ret = av_opt_set_int_list(filt_out, "color_ranges", color_ranges, AVCOL_RANGE_UNSPECIFIED, AV_OPT_SEARCH_CHILDREN)) < 0)
+        goto fail;
+
+     last_filter = filt_out;
 
 /* Note: this macro adds a filter before the lastly added filter, so the
  * processing order of the filters is in reverse */