History

avfilter/f_ebur128: also set max peak for all channels in frame metadata

Paul B Mahol committed 4 years ago

Commit e3f07181 parent e845c411 file · +5 −0Browse files

Unified · Split

libavfilter/f_ebur128.c+5−0
@@ -866,12 +866,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) · 865 unmodified lines
866866
867867 #define SET_META_PEAK(name, ptype) do { \
868868 if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
869+ double max_peak = 0.0; \
869870 char key[64]; \
870871 for (ch = 0; ch < nb_channels; ch++) { \
871872 snprintf(key, sizeof(key), \
872873 META_PREFIX AV_STRINGIFY(name) "_peaks_ch%d", ch); \
874+ max_peak = fmax(max_peak, ebur128->name##_peaks[ch]); \
873875 SET_META(key, ebur128->name##_peaks[ch]); \
874876 } \
877+ snprintf(key, sizeof(key), \
878+ META_PREFIX AV_STRINGIFY(name) "_peak"); \
879+ SET_META(key, max_peak); \
875880 } \
876881 } while (0)
877882

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t