From: Vincent Penquerc'h Date: Fri, 25 Nov 2011 14:00:18 +0000 (+0000) Subject: opusenc: only use mono streams for > 2 channels X-Git-Tag: 1.10.4~478^2~91^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ac75d10fd72b98be4b9b526a82f1286a2c2f48d;p=platform%2Fupstream%2Fgst-plugins-base.git opusenc: only use mono streams for > 2 channels I'm getting odd results with packing streams into stereo streams, and using only mono streams is enough in all cases. --- diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c index a926bbd..c6604c2 100644 --- a/ext/opus/gstopusenc.c +++ b/ext/opus/gstopusenc.c @@ -544,7 +544,7 @@ gst_opus_enc_setup (GstOpusEnc * enc) enc->state = opus_multistream_encoder_create (enc->sample_rate, enc->n_channels, - (enc->n_channels + 1) / 2, enc->n_channels / 2, trivial_mapping, + enc->n_channels, 0, trivial_mapping, enc->audio_or_voip ? OPUS_APPLICATION_AUDIO : OPUS_APPLICATION_VOIP, &error); if (!enc->state || error != OPUS_OK) diff --git a/ext/opus/gstopusheader.c b/ext/opus/gstopusheader.c index 1aa3b0d..42df7b3 100644 --- a/ext/opus/gstopusheader.c +++ b/ext/opus/gstopusheader.c @@ -44,8 +44,8 @@ gst_opus_enc_create_id_buffer (gint nchannels, gint sample_rate, gst_byte_writer_put_uint16_le (&bw, 0); /* output gain */ gst_byte_writer_put_uint8 (&bw, channel_mapping_family); if (channel_mapping_family > 0) { - gst_byte_writer_put_uint8 (&bw, (nchannels + 1) / 2); - gst_byte_writer_put_uint8 (&bw, nchannels / 2); + gst_byte_writer_put_uint8 (&bw, nchannels); + gst_byte_writer_put_uint8 (&bw, 0); gst_byte_writer_put_data (&bw, channel_mapping, nchannels); }