Stumbled upon this while updating mlt. It's a library that "implements the ebur R 128 loudness standard" (whatever that means)
Turns out both multimedia/mlt and audio/cantata bundle that code.
It's a very small library, just one file, but we should move to
the upstream version.
Two reasons:
- bundled version uses queue.h, but depends on its bundled version
instead of detecting and using the system one.
- bundled version uses outdated code. In particular, newer code
has a safe_multiply function that borrows directly from our memory
allocator, and hence avoids integer overflows.
A full grep of the package logs show no other possible users.
ffmpeg, as usual, plays the lone kid and has its own distinct
implementation of the ebur128 standard.
Here are patches to both mlt and cantata to use this, along with
the port itself as an attached tarball
(note: I will also need to check WANTLIB on consumers of cantata
and mlt, but that shouldn't be too hard)
Index: audio/Makefile
===================================================================
RCS file: /cvs/ports/audio/Makefile,v
retrieving revision 1.450
diff -u -p -r1.450 Makefile
--- audio/Makefile 20 Feb 2021 20:54:56 -0000 1.450
+++ audio/Makefile 7 Mar 2021 13:10:06 -0000
@@ -74,6 +74,7 @@
SUBDIR += libcue
SUBDIR += libdca
SUBDIR += libdiscid
+ SUBDIR += libebur128
SUBDIR += libgpod
SUBDIR += libid3tag
SUBDIR += liblastfm
Index: audio/cantata/Makefile
===================================================================
RCS file: /cvs/ports/audio/cantata/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- audio/cantata/Makefile 3 Oct 2020 07:21:50 -0000 1.23
+++ audio/cantata/Makefile 7 Mar 2021 13:10:06 -0000
@@ -5,6 +5,7 @@ COMMENT = Qt-based MPD client
V = 2.4.2
DISTNAME = cantata-${V}
HOMEPAGE = https://github.com/CDrummond/cantata
+REVISION = 0
MASTER_SITES = https://github.com/CDrummond/cantata/releases/download/v${V}/
EXTRACT_SUFX = .tar.bz2
@@ -27,6 +28,7 @@ RUN_DEPENDS += x11/gtk+3,-guic
LIB_DEPENDS += audio/mpg123 \
audio/libcdio \
audio/libcdio-paranoia \
+ audio/libebur128 \
audio/libcddb \
audio/libmusicbrainz5 \
audio/taglib \
Index: multimedia/mlt/Makefile
===================================================================
RCS file: /cvs/ports/multimedia/mlt/Makefile,v
retrieving revision 1.27
diff -u -p -r1.27 Makefile
--- multimedia/mlt/Makefile 24 Aug 2020 14:09:54 -0000 1.27
+++ multimedia/mlt/Makefile 7 Mar 2021 13:10:06 -0000
@@ -6,6 +6,7 @@ VERSION = 6.22.1
DISTNAME = mlt-${VERSION}
PKGNAME-main = ${DISTNAME}
PKGNAME-gpl2 = mlt-gpl2-${VERSION}
+REVISION = 0
# XXX versions should be kept in sync together
SHARED_LIBS = mlt 3.2
@@ -24,6 +25,7 @@ WANTLIB-main += ${COMPILER_LIBCXX} SDL S
WANTLIB-main += avfilter avformat avutil c exif fftw3 fontconfig gdk-x11-2.0
WANTLIB-main += gdk_pixbuf-2.0 glib-2.0 gobject-2.0 jack m pango-1.0
WANTLIB-main += pangoft2-1.0 sox swresample swscale vorbisfile xml2
+WANTLIB-main += ebur128
WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5Gui Qt5Svg Qt5Widgets
WANTLIB += Qt5Xml SDL2 exif m mlt samplerate
@@ -43,6 +45,7 @@ RUN_DEPENDS-main = audio/ladspa \
x11/gtk+3,-guic
LIB_DEPENDS-main = audio/jack \
+ audio/libebur128 \
audio/sox \
devel/sdl-image \
devel/sdl2 \
libebur128-1.2.6.tgz
Description: application/tar-gz
