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 963B544559 for ; Fri, 18 Nov 2022 14:25:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0B1DA68BBE3; Fri, 18 Nov 2022 16:25:38 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6920D68B8F2 for ; Fri, 18 Nov 2022 16:25:30 +0200 (EET) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id E334A483A1; Fri, 18 Nov 2022 15:25:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1668781530; bh=w90KTo/sBkfgVORqJNMMtrMs58IbX2sf3umyISyn1vI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m7C/dy9/mFvULAgBmaQ5Bas3wqfwfAUyTU0WkNiTpWbSCrTdDFDONo77i1aK9aeNb akk3pZ5QkjCgK+wlgDYn5YgoRmDdknxFStaPIbXHnbh7k/wstUbD+4HZURQgjE9VCW MvJT+vcNnE7pHL2RKp6r7QmTWIuWoUI74Yl/VDjI= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 18 Nov 2022 15:25:12 +0100 Message-Id: <20221118142512.72413-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118142512.72413-1-ffmpeg@haasn.xyz> References: <20221118142512.72413-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avfilter/vf_libplacebo: fix normalize_sar calculation 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 This previous expression multiplied a constant (outlink->h) that was guaranteed to be 0 at this point, thus making it always a no-op. Fix the calculation, and also properly reset the SAR to 1:1 as is now necessary (the failure to do so previously hid this bug's existence). --- libavfilter/vf_libplacebo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index d52833263d..921cdb36fd 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -576,12 +576,13 @@ static int libplacebo_config_output(AVFilterLink *outlink) s->force_original_aspect_ratio, s->force_divisible_by); - scale_sar = (AVRational){outlink->h * inlink->w, *out_w * *out_h}; + scale_sar = (AVRational){*out_h * inlink->w, *out_w * inlink->h}; if (inlink->sample_aspect_ratio.num) scale_sar = av_mul_q(scale_sar, inlink->sample_aspect_ratio); if (s->normalize_sar) { /* Apply all SAR during scaling, so we don't need to set the out SAR */ + outlink->sample_aspect_ratio = (AVRational){ 1, 1 }; s->target_sar = scale_sar; } else { /* This is consistent with other scale_* filters, which only -- 2.38.1 _______________________________________________ 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".