[FFmpeg-cvslog] avfilter/f_ebur128: also set max peak for all channels in frame metadata

Paul B Mahol git at videolan.org
Fri Feb 25 19:15:32 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Feb 25 11:48:19 2022 +0100| [e3f07185ed615e6e3fa1fe76db10ba367fb932ba] | committer: Paul B Mahol

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e3f07185ed615e6e3fa1fe76db10ba367fb932ba
---

 libavfilter/f_ebur128.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index f63cf77983..f71f32a9d4 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -866,12 +866,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
 
 #define SET_META_PEAK(name, ptype) do {                                     \
     if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) {               \
+        double max_peak = 0.0;                                              \
         char key[64];                                                       \
         for (ch = 0; ch < nb_channels; ch++) {                              \
             snprintf(key, sizeof(key),                                      \
                      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]);                       \
         }                                                                   \
+        snprintf(key, sizeof(key),                                          \
+                 META_PREFIX AV_STRINGIFY(name) "_peak");                   \
+        SET_META(key, max_peak);                                            \
     }                                                                       \
 } while (0)
 



More information about the ffmpeg-cvslog mailing list