Unified · Split
| @@ -866,12 +866,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) · 865 unmodified lines | |||
| 866 | 866 | ||
| 867 | #define SET_META_PEAK(name, ptype) do { \ | 867 | #define SET_META_PEAK(name, ptype) do { \ |
| 868 | if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \ | 868 | if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \ |
| 869 | double max_peak = 0.0; \ | ||
| 869 | char key[64]; \ | 870 | char key[64]; \ |
| 870 | for (ch = 0; ch < nb_channels; ch++) { \ | 871 | for (ch = 0; ch < nb_channels; ch++) { \ |
| 871 | snprintf(key, sizeof(key), \ | 872 | snprintf(key, sizeof(key), \ |
| 872 | META_PREFIX AV_STRINGIFY(name) "_peaks_ch%d", ch); \ | 873 | META_PREFIX AV_STRINGIFY(name) "_peaks_ch%d", ch); \ |
| 874 | max_peak = fmax(max_peak, ebur128->name##_peaks[ch]); \ | ||
| 873 | SET_META(key, ebur128->name##_peaks[ch]); \ | 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 | } while (0) | 881 | } while (0) |
| 877 | 882 | ||