1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avfilter/f_ebur128: properly propagate true peak

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: 3b26b782ee
This commit is contained in:
Niklas Haas
2025-06-23 20:47:22 +02:00
parent 60fc0288ae
commit f67ca10f2e

View File

@ -692,11 +692,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
double peak = dsp->find_peak(ebur128->true_peaks_per_frame, nb_channels, double peak = dsp->find_peak(ebur128->true_peaks_per_frame, nb_channels,
swr_samples, ret); swr_samples, ret);
ebur128->true_peak = DBFS(peak);
for (int ch = 0; ch < nb_channels; ch++) { 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[ch] = FFMAX(ebur128->true_peaks[ch],
ebur128->true_peaks_per_frame[ch]); ebur128->true_peaks_per_frame[ch]);
} }
ebur128->true_peak = DBFS(peak);
} }
#endif #endif