From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 557584D7E7 for ; Fri, 28 Nov 2025 12:47:31 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'EoVZMkS6Sy7MWb0NRPmoo15mogGk/wq6rxfj2xgyvwU=', expected b'dozYAwy8gL1x0vY+RZU0VWHGauwKHZyxo6kwk+K49Z8=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1764334036; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=EoVZMkS6Sy7MWb0NRPmoo15mogGk/wq6rxfj2xgyvwU=; b=xGe4IM7vNWtuh27c7EU9cF+LgEu+zcgPCwiJURUosPsI1xcLK21Y+p2t0IuvY2lmwGA9Z DQOI2ZS3z1NshVcu9wXqvwawr44e8qAkKAfQ5VSSKhkkjTvpwjCqQ+MYCK5BqKk2cAsWlXA NGAa05BOQDg3KajykOir6MteH9LqLBbT5KxwxQHOop/x6TUiU0jLzebIoe+HaDEOeKe90jr Vxn0ITZ8rTxW0p6O59GKobKT17difHhnrj7SOy0+J7e6xshijnlSoEEKXgoxvptbkKOMixJ eiSKvJD8Jes7gko1kFE1MuAxcWZWTxV6IL/d43mgh+2uUGbe2DCeANT2DxwQ== Received: from [172.19.0.3] (unknown [172.19.0.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 0218B69024B; Fri, 28 Nov 2025 14:47:16 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1764334022; b=oO7mB6NOKcO3ZFERIxcuqlcMuD5sLIi0HbABbRu8Ogx5OycFE5CREpO2G141B297ZIGy8 fNWtSIuEfGr/Ex5sUAtKheSY5HP2P5CcoyxwhCRmTmvZWkLnSMqdFypelUvT5l/miRT+Y1U AJ5scV6J+5YHsP7j/ltJiPHL3ROFlTvrMgfhV7/xmEGXR4c7RK9Q69YbnHiHj6MW8g/x3xm AclHWso9jMJtX7l8En1gDA2m5aZqT8OrfFZmlL+9wDyVsCad89ZsW1iUZ8eaY2DN5Ufl9hU GVLDUeMconPgHQgBZ/ufhfdIXpczl/RkkiJFZHq1YLbXkgRuGvkrrqRJkcIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1764334022; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=12ulaFBLF6DIdpkWi3qkLFiTLgj1W5e/cMuUL3eB12g=; b=dwulEoy+OTyOslVNeilHbaJSG53xtBF5R58A98hGS3PO+P9T54+qkB8w7Q77D8+sYqnSY PIfPNSA2xB+2iWPCJgr4F1aKjQ2zA7cBPvg+uRuyjQ1lryIMGQWTnSQ+d635PRfSAtfBTSn ap4rLbVn7GRjUvNNyIdGOt1oAgIFslkad6OHmLInwyfnha9cvV5PsZxHVc83AbrQ4yPff2D aj6N5Mp+T/v8Oko9HB99qFsJFQOfPOJgEdrJo0cbIZA6x6mvyxl+70yp7abzQDG+c0eHtiH FZf9Wl50o2+Sjcq1ZLKyG8O6pPzn4Of9JvihCInxHA+23kFWkfj+WbxD5i0Q== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1764334013; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=dozYAwy8gL1x0vY+RZU0VWHGauwKHZyxo6kwk+K49Z8=; b=1hy8osWjULVsYFIlhyiGQ31s0ncQywiNnk0O9vSy3gFx/9eR4fsSZL7NZbu/C0YRUb2AS D3EkCldCecxM0gKWLOC0pskCvWvQF9GFbc44x/KQFIAHZ3HqdlVjmdqWN/3+tKDDQ08aSot jdnXE2u5Hu+7IgFOD6vArPWbZTN2Fv0djNHar81tMYwswANu/fVWx4/s+RgnU12EQU0Bmc2 R519U3y0PGVZxK+T3HLnNSvJYgF9f6KMh6XbC2SYJyX98ZVkEcPrc3CwRNKM/EmsQT0c0cG e2Rx140IAITSplH4eJ56z07A896GTwHbh0KWTcacHano4+Av+aH7EVWVxYdA== Received: from 55ca25703178 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 39F03690102 for ; Fri, 28 Nov 2025 14:46:53 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Fri, 28 Nov 2025 12:46:52 -0000 Message-ID: <176433401340.39.7603462918113484758@2cb04c0e5124> Message-ID-Hash: UKZ4IHRWKTTVO4X4NO52P2QY2G7UYWYG X-Message-ID-Hash: UKZ4IHRWKTTVO4X4NO52P2QY2G7UYWYG X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avfilter/vf_libplacebo: always pass through SAR when stretching (PR #21038) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Niklas Haas via ffmpeg-devel Cc: Niklas Haas Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21038 opened by Niklas Haas (haasn) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21038 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21038.patch The current logic assumes `s->reset_sar` always resets the SAR, but this is only true if `force_oar` is actually true as well, meaning that in the case of `s->reset_sar && !force_oar`, the SAR is incorrectly set to 1:1. While we could fix this by also forcing `force_oar` for multiple inputs, that would have unintended consequences when the user explicitly sets the desired resolution. Instead, pass-through the SAR in this case; matching the intended behavior of inheriting the SAR from the base layer input. >>From 0ab721603cd708327d70ac9721950778fe2d7b5c Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 28 Nov 2025 13:43:27 +0100 Subject: [PATCH] avfilter/vf_libplacebo: always pass through SAR when stretching The current logic assumes `s->reset_sar` always resets the SAR, but this is only true if `force_oar` is actually true as well, meaning that in the case of `s->reset_sar && !force_oar`, the SAR is incorrectly set to 1:1. While we could fix this by also forcing `force_oar` for multiple inputs, that would have unintended consequences when the user explicitly sets the desired resolution. Instead, pass-through the SAR in this case; matching the intended behavior of inheriting the SAR from the base layer input. --- libavfilter/vf_libplacebo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 42501c51f2..c5085aa7e9 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -1507,10 +1507,7 @@ static int libplacebo_config_output(AVFilterLink *outlink) } } - if (s->reset_sar) { - /* SAR is normalized, or we have multiple inputs, set out to 1:1 */ - outlink->sample_aspect_ratio = (AVRational){ 1, 1 }; - } else if (inlink->sample_aspect_ratio.num && s->fit_mode == FIT_FILL) { + if (inlink->sample_aspect_ratio.num && s->fit_mode == FIT_FILL) { /* This is consistent with other scale_* filters, which only * set the outlink SAR to be equal to the scale SAR iff the input SAR * was set to something nonzero */ @@ -1518,6 +1515,9 @@ static int libplacebo_config_output(AVFilterLink *outlink) const AVRational ar_out = { outlink->w, outlink->h }; const AVRational stretch = av_div_q(ar_in, ar_out); outlink->sample_aspect_ratio = av_mul_q(inlink->sample_aspect_ratio, stretch); + } else if (s->reset_sar) { + /* SAR is normalized, or we have multiple inputs, set out to 1:1 */ + outlink->sample_aspect_ratio = (AVRational){ 1, 1 }; } else { outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; } -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org