{
gint i, j;
guint64 channel_mask = 0;
- gboolean none_layout = FALSE;
if (channels == 1 && position[0] == GST_AUDIO_CHANNEL_POSITION_MONO) {
if (channel_mask_out)
return TRUE;
}
+ if (channels > 0 && position[0] == GST_AUDIO_CHANNEL_POSITION_NONE) {
+ if (channel_mask_out)
+ *channel_mask_out = 0;
+ return TRUE;
+ }
+
j = 0;
for (i = 0; i < channels; i++) {
while (j < G_N_ELEMENTS (default_channel_order)
position[i] == GST_AUDIO_CHANNEL_POSITION_MONO)
return FALSE;
- if (position[i] == GST_AUDIO_CHANNEL_POSITION_NONE) {
- none_layout = TRUE;
- continue;
- }
-
/* Is this in valid channel order? */
if (enforce_order && j == G_N_ELEMENTS (default_channel_order))
return FALSE;
channel_mask |= (G_GUINT64_CONSTANT (1) << position[i]);
}
- if (none_layout && channel_mask != 0)
- return FALSE;
-
if (channel_mask_out)
*channel_mask_out = channel_mask;