23 #include <opus_multistream.h>
38 #define OPUS_HEAD_SIZE 19
43 int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled;
44 uint8_t mapping_arr[8] = { 0, 1 }, *mapping;
59 if (nb_streams + nb_coupled != avc->
channels)
63 if (avc->
channels > 2 || channel_map) {
65 "No channel mapping for %d channels.\n", avc->
channels);
70 mapping = mapping_arr;
78 for (ch = 0; ch < avc->
channels; ch++)
79 mapping_arr[ch] = mapping[vorbis_offset[ch]];
80 mapping = mapping_arr;
84 nb_streams, nb_coupled,
92 ret = opus_multistream_decoder_ctl(opus->
dec, OPUS_SET_GAIN(gain_db));
107 opus_multistream_decoder_destroy(opus->
dec);
111 #define MAX_FRAME_SIZE (960 * 6)
127 nb_samples = opus_multistream_decode(opus->
dec, pkt->
data, pkt->
size,
131 nb_samples = opus_multistream_decode_float(opus->
dec, pkt->
data, pkt->
size,
135 if (nb_samples < 0) {
137 opus_strerror(nb_samples));
151 opus_multistream_decoder_ctl(opus->
dec, OPUS_RESET_STATE);