diff --git a/gst/audiomixer/gstaudiointerleave.c b/gst/audiomixer/gstaudiointerleave.c index e91b6454b4..f4e9fa1073 100644 --- a/gst/audiomixer/gstaudiointerleave.c +++ b/gst/audiomixer/gstaudiointerleave.c @@ -330,7 +330,8 @@ gst_audio_interleave_get_channel_mask (GstAudioInterleave * self) { guint64 channel_mask = 0; - if (self->channel_positions != NULL && + if (self->channels <= 64 && + self->channel_positions != NULL && self->channels == self->channel_positions->n_values) { if (!gst_audio_interleave_channel_positions_to_mask (self->channel_positions, self->default_channels_ordering_map, @@ -338,7 +339,7 @@ gst_audio_interleave_get_channel_mask (GstAudioInterleave * self) GST_WARNING_OBJECT (self, "Invalid channel positions, using NONE"); channel_mask = 0; } - } else { + } else if (self->channels <= 64) { GST_WARNING_OBJECT (self, "Using NONE channel positions"); } @@ -826,7 +827,7 @@ gst_audio_interleave_aggregate_one_buffer (GstAudioAggregator * aagg, GstAudioInterleavePad *pad = GST_AUDIO_INTERLEAVE_PAD (aaggpad); GstMapInfo inmap; GstMapInfo outmap; - gint out_width, in_bpf, out_bpf, out_channels; + gint out_width, in_bpf, out_bpf, out_channels, channel; guint8 *outdata; out_width = GST_AUDIO_INFO_WIDTH (&aagg->info) / 8; @@ -840,8 +841,13 @@ gst_audio_interleave_aggregate_one_buffer (GstAudioAggregator * aagg, " from offset %u", num_frames, pad->channel, out_channels, out_offset * out_bpf, in_offset * in_bpf); - outdata = outmap.data + (out_offset * out_bpf) + - (out_width * self->default_channels_ordering_map[pad->channel]); + if (self->channels > 64) { + channel = pad->channel; + } else { + channel = self->default_channels_ordering_map[pad->channel]; + } + + outdata = outmap.data + (out_offset * out_bpf) + (out_width * channel); self->func (outdata, inmap.data + (in_offset * in_bpf), out_channels,