]> git.sesse.net Git - vlc/commitdiff
Fixed selection of simple mixer (close #1688)
authorLaurent Aimar <fenrir@videolan.org>
Wed, 9 Jul 2008 20:40:05 +0000 (20:40 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 9 Jul 2008 20:42:43 +0000 (20:42 +0000)
This mixer can only downsample.
Let trivial mixer handles
Dual-Mono -> Stereo|Stereo-left|Stereo-right|Stereo-reverse.
(Please double check on your multiple channels sources)

modules/audio_filter/channel_mixer/simple.c

index ba6580d39a5fb2e88677b8718e3aa3eae243d25d..f95ce67f46b0faff2cc9f718563945ba846c370d 100644 (file)
@@ -282,13 +282,13 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
  *****************************************************************************/
 static bool IsSupported( const audio_format_t *p_input, const audio_format_t *p_output )
 {
-    if ( (p_input->i_physical_channels
-           == p_output->i_physical_channels
-           && p_input->i_original_channels
-               == p_output->i_original_channels)
-          || p_input->i_format != p_output->i_format
-          || p_input->i_rate != p_output->i_rate
-          || p_input->i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_input->i_format != VLC_FOURCC('f','l','3','2') ||
+          p_input->i_format != p_output->i_format ||
+          p_input->i_rate != p_output->i_rate )
+        return false;
+
+    if( p_input->i_physical_channels == p_output->i_physical_channels &&
+        p_input->i_original_channels == p_output->i_original_channels )
     {
         return false;
     }
@@ -308,5 +308,11 @@ static bool IsSupported( const audio_format_t *p_input, const audio_format_t *p_
     {
         return false;
     }
+
+    /* Only if we downmix */
+    if( aout_FormatNbChannels( p_input ) <= aout_FormatNbChannels( p_output ) )
+        return false;
+
     return true;
 }
+