23 #include <opus_multistream.h>
37 #define OPUS_HEAD_SIZE 19
42 int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled;
43 uint8_t mapping_arr[8] = { 0, 1 }, *mapping;
58 if (nb_streams + nb_coupled != avc->
channels)
62 if (avc->
channels > 2 || channel_map) {
64 "No channel mapping for %d channels.\n", avc->
channels);
69 mapping = mapping_arr;
77 for (ch = 0; ch < avc->
channels; ch++)
78 mapping_arr[ch] = mapping[vorbis_offset[ch]];
79 mapping = mapping_arr;
83 nb_streams, nb_coupled,
91 ret = opus_multistream_decoder_ctl(opus->
dec, OPUS_SET_GAIN(gain_db));
105 opus_multistream_decoder_destroy(opus->
dec);
109 #define MAX_FRAME_SIZE (960 * 6)
126 nb_samples = opus_multistream_decode(opus->
dec, pkt->
data, pkt->
size,
127 (opus_int16 *)frame->
data[0],
130 nb_samples = opus_multistream_decode_float(opus->
dec, pkt->
data, pkt->
size,
131 (
float *)frame->
data[0],
134 if (nb_samples < 0) {
136 opus_strerror(nb_samples));
150 opus_multistream_decoder_ctl(opus->
dec, OPUS_RESET_STATE);