summaryrefslogtreecommitdiff
path: root/subprojects
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2024-05-09 09:57:54 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2024-05-12 07:06:32 +0000
commit399b147d900b4f79922d6cc89eb6fb2414ff3ae1 (patch)
treefd2a9a4365b090fd264cbb3ecf75d8c8dd912d71 /subprojects
parentd68ac0db571f44cae42b57c876436b3b09df616b (diff)
audioconvert: Support converting >64 channels
There's nothing requiring <= 64 channels except for getting the reorder map and creating a channel mixing matrix, but those won't be possible to call anyway as channel positions can only express up to 64 channels. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6819>
Diffstat (limited to 'subprojects')
-rw-r--r--subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c4
-rw-r--r--subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c
index 7b0f132534..2359eae3b6 100644
--- a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c
+++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c
@@ -958,8 +958,6 @@ gst_audio_channel_mixer_new_with_matrix (GstAudioChannelMixerFlags flags,
|| format == GST_AUDIO_FORMAT_S32
|| format == GST_AUDIO_FORMAT_F32
|| format == GST_AUDIO_FORMAT_F64, NULL);
- g_return_val_if_fail (in_channels > 0 && in_channels <= 64, NULL);
- g_return_val_if_fail (out_channels > 0 && out_channels <= 64, NULL);
mix = g_new0 (GstAudioChannelMixer, 1);
mix->in_channels = in_channels;
@@ -1120,8 +1118,6 @@ gst_audio_channel_mixer_new (GstAudioChannelMixerFlags flags,
|| format == GST_AUDIO_FORMAT_S32
|| format == GST_AUDIO_FORMAT_F32
|| format == GST_AUDIO_FORMAT_F64, NULL);
- g_return_val_if_fail (in_channels > 0 && in_channels <= 64, NULL);
- g_return_val_if_fail (out_channels > 0 && out_channels <= 64, NULL);
matrix =
gst_audio_channel_mixer_setup_matrix (flags, in_channels, in_position,
diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c
index 8f18c285c0..ea1b533c7f 100644
--- a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c
+++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c
@@ -222,7 +222,6 @@ gst_audio_reorder_channels (gpointer data, gsize size, GstAudioFormat format,
g_return_val_if_fail (info->width <= 8 * 64, FALSE);
g_return_val_if_fail (size % ((info->width * channels) / 8) == 0, FALSE);
g_return_val_if_fail (channels > 0, FALSE);
- g_return_val_if_fail (channels <= 64, FALSE);
if (size == 0)
return TRUE;
@@ -230,6 +229,8 @@ gst_audio_reorder_channels (gpointer data, gsize size, GstAudioFormat format,
if (gst_audio_channel_positions_equal (from, to, channels))
return TRUE;
+ g_return_val_if_fail (channels <= 64, FALSE);
+
if (!gst_audio_get_channel_reorder_map (channels, from, to, reorder_map))
return FALSE;
@@ -454,6 +455,7 @@ gst_audio_get_channel_reorder_map (gint channels,
g_return_val_if_fail (reorder_map != NULL, FALSE);
g_return_val_if_fail (channels > 0, FALSE);
+ g_return_val_if_fail (channels <= 64, FALSE);
g_return_val_if_fail (from != NULL, FALSE);
g_return_val_if_fail (to != NULL, FALSE);
g_return_val_if_fail (check_valid_channel_positions (from, channels, FALSE,