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 72B70454BC for ; Fri, 26 Apr 2024 12:28:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BF34C68D442; Fri, 26 Apr 2024 15:28:15 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D620568D418 for ; Fri, 26 Apr 2024 15:28:06 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1714134486; bh=IDT14CE5LW8BEzBmjnrX5Y43Ao2QE1IYjOwAJ117RrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p85uHsAh7xLXkegDm40c2vnmpcgPYH8EKPkWkFCmuV5oujcPhae45bKnfFngBAKA1 2bd+3iuvnflBN4ncYk3yctn+R+aTg3hGT2s2AV4efj4JuNtoMqKxyQakjwaK9MII7y UnFNstvAMQ+3lu4zC4oAQyV78N4GgZOrUnWXHP18= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 9A4174105D; Fri, 26 Apr 2024 14:28:06 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 26 Apr 2024 14:28:00 +0200 Message-ID: <20240426122803.19967-3-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240426122803.19967-1-ffmpeg@haasn.xyz> References: <20240426122803.19967-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/6] avfilter/vf_zscale: strip metadata on change 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: Niklas Haas 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: From: Niklas Haas Required for both size chnages and color volume changes (as a result of changing primaries/transfer). --- libavfilter/vf_zscale.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c index 45f1bd25ce..c012464615 100644 --- a/libavfilter/vf_zscale.c +++ b/libavfilter/vf_zscale.c @@ -783,7 +783,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format); const AVPixFmtDescriptor *odesc = av_pix_fmt_desc_get(outlink->format); char buf[32]; - int ret = 0; + int ret = 0, changed = 0; AVFrame *out = NULL; ThreadData td; @@ -880,6 +880,12 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h, INT_MAX); + if (out->width != in->width || out->height != in->height) + changed |= AV_FRAME_CHANGED_SIZE; + if (out->color_trc != in->color_trc || out->color_primaries != in->color_primaries) + changed |= AV_FRAME_CHANGED_COLOR_VOLUME; + av_frame_remove_side_data_changed(out, changed); + td.in = in; td.out = out; td.desc = desc; -- 2.44.0 _______________________________________________ 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".