avfilter/f_ebur128: properly propagate true peak
After3b26b782ee, `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:
parent
60fc0288ae
commit
f67ca10f2e
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue