]> git.sesse.net Git - vlc/commitdiff
put mono audio in both (left/right) channels. For some reason AOUT_CHAN_CENTER doesn...
authorJean-Paul Saman <jpsaman@videolan.org>
Wed, 23 Aug 2006 21:59:47 +0000 (21:59 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Wed, 23 Aug 2006 21:59:47 +0000 (21:59 +0000)
modules/audio_filter/converter/mono.c

index 3bea3beee8563161855c783334105d96296d257d..09159e933c7691e4d120cdc80ee87b53a2a2d19c 100644 (file)
@@ -142,10 +142,10 @@ static int OpenFilter( vlc_object_t *p_this )
 
 #if 0
     p_filter->fmt_out.audio.i_physical_channels = AOUT_CHAN_CENTER;
-#endif
+#else
     p_filter->fmt_out.audio.i_physical_channels =
                             (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT);
-
+#endif
     p_filter->fmt_out.audio.i_rate = p_filter->fmt_in.audio.i_rate;
     p_filter->fmt_out.audio.i_format = p_filter->fmt_out.i_codec;
 
@@ -261,14 +261,9 @@ static unsigned int stereo_to_mono( aout_instance_t * p_aout, aout_filter_t *p_f
 
     for( n = 0; n < (p_input->i_nb_samples * p_sys->i_nb_channels); n++ )
     {
-        if( (n%p_sys->i_nb_channels) == p_sys->i_channel_selected )
-        {
-            p_out[n] = (p_in[n] + p_in[n+1]) >> 1;
-        }
-        else
-        {
-            p_out[n] = 0x0;
-        }
+        /* Fake real mono. */
+        p_out[n] = (p_in[n] + p_in[n+1]) >> 1;
+        n++;
     }
     return n;
 }