mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-02 02:03:54 +00:00
audiointerleave: Use the channel count from the set caps
This is the same number that was used to allocate the buffer
This commit is contained in:
parent
10319757b4
commit
45ef27aa46
1 changed files with 4 additions and 3 deletions
|
@ -822,24 +822,25 @@ gst_audio_interleave_aggregate_one_buffer (GstAudioAggregator * aagg,
|
||||||
GstAudioInterleavePad *pad = GST_AUDIO_INTERLEAVE_PAD (aaggpad);
|
GstAudioInterleavePad *pad = GST_AUDIO_INTERLEAVE_PAD (aaggpad);
|
||||||
GstMapInfo inmap;
|
GstMapInfo inmap;
|
||||||
GstMapInfo outmap;
|
GstMapInfo outmap;
|
||||||
gint out_width, in_bpf, out_bpf;
|
gint out_width, in_bpf, out_bpf, out_channels;
|
||||||
guint8 *outdata;
|
guint8 *outdata;
|
||||||
|
|
||||||
out_width = GST_AUDIO_INFO_WIDTH (&aagg->info) / 8;
|
out_width = GST_AUDIO_INFO_WIDTH (&aagg->info) / 8;
|
||||||
in_bpf = GST_AUDIO_INFO_BPF (&aaggpad->info);
|
in_bpf = GST_AUDIO_INFO_BPF (&aaggpad->info);
|
||||||
out_bpf = GST_AUDIO_INFO_BPF (&aagg->info);
|
out_bpf = GST_AUDIO_INFO_BPF (&aagg->info);
|
||||||
|
out_channels = GST_AUDIO_INFO_CHANNELS (&aagg->info);
|
||||||
|
|
||||||
gst_buffer_map (outbuf, &outmap, GST_MAP_READWRITE);
|
gst_buffer_map (outbuf, &outmap, GST_MAP_READWRITE);
|
||||||
gst_buffer_map (inbuf, &inmap, GST_MAP_READ);
|
gst_buffer_map (inbuf, &inmap, GST_MAP_READ);
|
||||||
GST_LOG_OBJECT (pad, "interleaves %u frames on channel %d/%d at offset %u"
|
GST_LOG_OBJECT (pad, "interleaves %u frames on channel %d/%d at offset %u"
|
||||||
" from offset %u", num_frames, pad->channel, self->channels,
|
" from offset %u", num_frames, pad->channel, out_channels,
|
||||||
out_offset * out_bpf, in_offset * in_bpf);
|
out_offset * out_bpf, in_offset * in_bpf);
|
||||||
|
|
||||||
outdata = outmap.data + (out_offset * out_bpf) +
|
outdata = outmap.data + (out_offset * out_bpf) +
|
||||||
(out_width * self->default_channels_ordering_map[pad->channel]);
|
(out_width * self->default_channels_ordering_map[pad->channel]);
|
||||||
|
|
||||||
|
|
||||||
self->func (outdata, inmap.data + (in_offset * in_bpf), self->channels,
|
self->func (outdata, inmap.data + (in_offset * in_bpf), out_channels,
|
||||||
num_frames);
|
num_frames);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue