Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -866,12 +866,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) · 865 unmodified lines | ||
| 866 | 866 | |
| 867 | 867 | #define SET_META_PEAK(name, ptype) do { \ |
| 868 | 868 | if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \ |
| 869 | + double max_peak = 0.0; \ | |
| 869 | 870 | char key[64]; \ |
| 870 | 871 | for (ch = 0; ch < nb_channels; ch++) { \ |
| 871 | 872 | snprintf(key, sizeof(key), \ |
| 872 | 873 | META_PREFIX AV_STRINGIFY(name) "_peaks_ch%d", ch); \ |
| 874 | + max_peak = fmax(max_peak, ebur128->name##_peaks[ch]); \ | |
| 873 | 875 | SET_META(key, ebur128->name##_peaks[ch]); \ |
| 874 | 876 | } \ |
| 877 | + snprintf(key, sizeof(key), \ | |
| 878 | + META_PREFIX AV_STRINGIFY(name) "_peak"); \ | |
| 879 | + SET_META(key, max_peak); \ | |
| 875 | 880 | } \ |
| 876 | 881 | } while (0) |
| 877 | 882 | |