diff mbox

[FFmpeg-devel,22/24] avfilter/vf_setrange: change outlink color_range too

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

Commit Message

Paul B Mahol May 1, 2018, 7:40 p.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavfilter/vf_setparams.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/libavfilter/vf_setparams.c b/libavfilter/vf_setparams.c
index 8427f98ba8..98a4aa2ad3 100644
--- a/libavfilter/vf_setparams.c
+++ b/libavfilter/vf_setparams.c
@@ -56,6 +56,16 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     return ff_filter_frame(ctx->outputs[0], frame);
 }
 
+static int config_output(AVFilterLink *outlink)
+{
+    SetParamsContext *s = outlink->src->priv;
+
+    if (s->color_range >= 0)
+        outlink->color_range = s->color_range;
+
+    return 0;
+}
+
 static const AVFilterPad inputs[] = {
     {
         .name         = "default",
@@ -69,6 +79,7 @@  static const AVFilterPad outputs[] = {
     {
         .name = "default",
         .type = AVMEDIA_TYPE_VIDEO,
+        .config_props = config_output,
     },
     { NULL }
 };