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.
This commit is contained in:
Vincent Penquerc'h 2011-11-25 14:00:18 +00:00
parent 287a0c646e
commit 8ac75d10fd
2 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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);
}