From: Vincent Penquerc'h Date: Fri, 25 Nov 2011 12:40:31 +0000 (+0000) Subject: opusenc: do not cause the decoder to apply the channel mapping again X-Git-Tag: 1.10.4~478^2~91^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=605d407b16d3ae7bea5c5a10f4908be223245784;p=platform%2Fupstream%2Fgst-plugins-base.git opusenc: do not cause the decoder to apply the channel mapping again Since we already reorder channels, we do not want to write that reordering in the header, or the decoder will do it again. --- diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c index 6dad531..11ddcc1 100644 --- a/ext/opus/gstopusenc.c +++ b/ext/opus/gstopusenc.c @@ -532,13 +532,17 @@ gst_opus_enc_set_format (GstAudioEncoder * benc, GstAudioInfo * info) static gboolean gst_opus_enc_setup (GstOpusEnc * enc) { - int error = OPUS_OK; + int error = OPUS_OK, n; + guint8 trivial_mapping[256]; GST_DEBUG_OBJECT (enc, "setup"); + for (n = 0; n < 256; ++n) + trivial_mapping[n] = n; + enc->state = opus_multistream_encoder_create (enc->sample_rate, enc->n_channels, - (enc->n_channels + 1) / 2, enc->n_channels / 2, enc->channel_mapping, + (enc->n_channels + 1) / 2, enc->n_channels / 2, trivial_mapping, enc->audio_or_voip ? OPUS_APPLICATION_AUDIO : OPUS_APPLICATION_VOIP, &error); if (!enc->state || error != OPUS_OK)