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 0819D4F97E for ; Mon, 23 Jun 2025 18:51:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 26BA968DE58; Mon, 23 Jun 2025 21:51:16 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 8B46768D59D for ; Mon, 23 Jun 2025 21:51:09 +0300 (EEST) Received: from haasn.dev (unknown [10.30.1.1]) by haasn.dev (Postfix) with UTF8SMTP id CF9AD40677; Mon, 23 Jun 2025 20:51:08 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Jun 2025 20:51:07 +0200 Message-ID: <20250623185107.19613-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter/f_ebur128: properly propagate true peak 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 After 3b26b782ee, `ebur128->true_peak` was only set to the maximum of the current "true peak per frame" values, when it should report the true peak for the entire stream. Fixes: 3b26b782eeded9b9ab7fac013cd1a83a30d68206 --- libavfilter/f_ebur128.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index 80cbe20330..63669b71de 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -692,11 +692,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) double peak = dsp->find_peak(ebur128->true_peaks_per_frame, nb_channels, swr_samples, ret); - ebur128->true_peak = DBFS(peak); for (int ch = 0; ch < nb_channels; ch++) { + peak = FFMAX(peak, ebur128->true_peaks[ch]); ebur128->true_peaks[ch] = FFMAX(ebur128->true_peaks[ch], ebur128->true_peaks_per_frame[ch]); } + + ebur128->true_peak = DBFS(peak); } #endif -- 2.49.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".