shithub: opus

Download patch

ref: 58d80ab9ea3b2d54042debb445c08bf490758fce
parent: fcecd29abf32164326e568acdcdf7d8e877b33b1
author: Jean-Marc Valin <[email protected]>
date: Mon May 27 16:47:47 EDT 2013

Disables all the surround mode forcing for mono/stereo

--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -189,7 +189,7 @@
       if(ret!=OPUS_OK)return ret;
       ptr += align(mono_size);
    }
-   if (surround && st->layout.nb_channels>2)
+   if (surround)
    {
       OpusEncoder *downmix_enc;
       downmix_enc = (OpusEncoder*)ptr;
@@ -258,7 +258,8 @@
          mapping[i] = i;
    } else
       return OPUS_UNIMPLEMENTED;
-   opus_multistream_encoder_init_impl(st, Fs, channels, *streams, *coupled_streams, mapping, application, 1);
+   opus_multistream_encoder_init_impl(st, Fs, channels, *streams, *coupled_streams,
+         mapping, application, channels>2&&mapping_family==1);
    return OPUS_OK;
 }
 
@@ -496,7 +497,7 @@
    coupled_size = opus_encoder_get_size(2);
    mono_size = opus_encoder_get_size(1);
 
-   if (st->surround && st->layout.nb_channels>2)
+   if (st->surround)
    {
       int i;
       unsigned char dummy[512];