From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 245C1498E7 for ; Sat, 23 Mar 2024 12:12:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4301668D43A; Sat, 23 Mar 2024 14:12:05 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E52C068D40C for ; Sat, 23 Mar 2024 14:11:58 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1711195918; bh=eAXnSEvRpKNVGf5SHXRyprBdkG6S6X3RO8c6KZVo/Ys=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=axAFrtO+mI7Ybhn4hRRFfEBvwosj8SkW9Wesa1mlPkTgMf6E4h0gYBG+sEqiSXrrJ s2h7QdQfJRPgWQaw5e4Y6SxZAt4eStIWhEzA4YmNzJ7FS/9g50PH5iB7hmFVuG2Knn MU9b+e+GEDUbn40ZdrppqfJM7P1T208iyouayfDg= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 92EBB4223F; Sat, 23 Mar 2024 13:11:58 +0100 (CET) Date: Sat, 23 Mar 2024 13:11:58 +0100 Message-ID: <20240323131158.GB18704@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: <20240322210239.68833-1-damiog@gmail.com> References: <20240322210239.68833-1-damiog@gmail.com> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH] avfilter: propagate colorspace and color_range from buffer filter and between AVFilterLink. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Damiano Galassi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, 22 Mar 2024 22:02:39 +0100 Damiano Galassi wrote: > There two new fields were never sent down the filter chain, and no filter after the first had colorspace and color_range set, causing breakage in zscale and possible other filters. > --- > libavfilter/avfilter.c | 4 ++++ > libavfilter/buffersrc.c | 2 ++ > 2 files changed, 6 insertions(+) > > diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c > index 831871de90..153fb700d3 100644 > --- a/libavfilter/avfilter.c > +++ b/libavfilter/avfilter.c > @@ -391,6 +391,10 @@ int ff_filter_config_links(AVFilterContext *filter) > link->w = inlink->w; > if (!link->h) > link->h = inlink->h; > + if (link->colorspace == AVCOL_SPC_UNSPECIFIED) > + link->colorspace = inlink->color_range; > + if (link->color_range == AVCOL_RANGE_UNSPECIFIED) > + link->color_range = inlink->color_range; > } else if (!link->w || !link->h) { > av_log(link->src, AV_LOG_ERROR, > "Video source filters must set their output link's " > diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c > index ddcd403785..2760097edf 100644 > --- a/libavfilter/buffersrc.c > +++ b/libavfilter/buffersrc.c > @@ -499,6 +499,8 @@ static int config_props(AVFilterLink *link) > link->w = c->w; > link->h = c->h; > link->sample_aspect_ratio = c->pixel_aspect; > + link->colorspace = c->color_space; > + link->color_range = c->color_range; > > if (c->hw_frames_ctx) { > link->hw_frames_ctx = av_buffer_ref(c->hw_frames_ctx); LGTM, good catch! _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".