From 70b7c4560d921c9ae571b8063ee8bb1db8b825e7 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 12 Mar 2025 12:29:20 +0300 Subject: [PATCH] `gst_channel_to_ebur_channel()`: handle new top-surround channels These seem to have appeared in gstreamer 1.26, which is the version we need to use to guard the handling. These are effectively geometrically located on the same azimuth, but on the layer above than the non-top (i.e. middle layer) surround channels. But they are still surround channels, which ebur128 does not bias loudness-wise. At least this is my understanding. --- src/engine/ebur128analysis.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/engine/ebur128analysis.cpp b/src/engine/ebur128analysis.cpp index ce42f1183..8ded1d3b0 100644 --- a/src/engine/ebur128analysis.cpp +++ b/src/engine/ebur128analysis.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -89,6 +90,13 @@ channel gst_channel_to_ebur_channel(GstAudioChannelPosition pos) { case GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT: return EBUR128_RIGHT_SURROUND; +#if (GST_PLUGINS_BASE_VERSION_MAJOR > 1 || (GST_PLUGINS_BASE_VERSION_MAJOR == 1 && GST_PLUGINS_BASE_VERSION_MINOR >= 26)) + case GST_AUDIO_CHANNEL_POSITION_TOP_SURROUND_LEFT: + return EBUR128_LEFT_SURROUND; + case GST_AUDIO_CHANNEL_POSITION_TOP_SURROUND_RIGHT: + return EBUR128_RIGHT_SURROUND; +#endif + case GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_CENTER: return EBUR128_Bp000;