avfilter/f_ebur128: also set max peak for all channels in frame metadata
This commit is contained in:
parent
e845c41c94
commit
e3f07185ed
@ -866,12 +866,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
|
|||||||
|
|
||||||
#define SET_META_PEAK(name, ptype) do { \
|
#define SET_META_PEAK(name, ptype) do { \
|
||||||
if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
|
if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
|
||||||
|
double max_peak = 0.0; \
|
||||||
char key[64]; \
|
char key[64]; \
|
||||||
for (ch = 0; ch < nb_channels; ch++) { \
|
for (ch = 0; ch < nb_channels; ch++) { \
|
||||||
snprintf(key, sizeof(key), \
|
snprintf(key, sizeof(key), \
|
||||||
META_PREFIX AV_STRINGIFY(name) "_peaks_ch%d", ch); \
|
META_PREFIX AV_STRINGIFY(name) "_peaks_ch%d", ch); \
|
||||||
|
max_peak = fmax(max_peak, ebur128->name##_peaks[ch]); \
|
||||||
SET_META(key, ebur128->name##_peaks[ch]); \
|
SET_META(key, ebur128->name##_peaks[ch]); \
|
||||||
} \
|
} \
|
||||||
|
snprintf(key, sizeof(key), \
|
||||||
|
META_PREFIX AV_STRINGIFY(name) "_peak"); \
|
||||||
|
SET_META(key, max_peak); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user