]> git.sesse.net Git - vlc/commitdiff
- Dolby Surround fix
authorBoris Dorès <babal@videolan.org>
Tue, 11 Feb 2003 17:20:44 +0000 (17:20 +0000)
committerBoris Dorès <babal@videolan.org>
Tue, 11 Feb 2003 17:20:44 +0000 (17:20 +0000)
- support for 6.1, 7.1, and possibly even 8.1 ! Not so sure though about
  6.1 since there is a doubt about where should be the Rear Center
  coefficient in a decoded sample.
  -> if anybody has an idea or even better a test stream...

modules/audio_filter/channel_mixer/headphone.c

index 5ae9dae9832d374fcc1dd2fcb0a2b22137df5572..ac1878a2249cb22a3ded6e9a072516921cf8d9a6 100644 (file)
@@ -3,7 +3,7 @@
  *               -> gives the feeling of a real room with a simple headphone
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: headphone.c,v 1.2 2003/02/11 11:16:04 massiot Exp $
+ * $Id: headphone.c,v 1.3 2003/02/11 17:20:44 babal Exp $
  *
  * Authors: Boris Dorès <babal@via.ecp.fr>
  *
@@ -209,6 +209,14 @@ static int Init ( aout_filter_t * p_filter , struct aout_filter_sys_t * p_data
         i_next_atomic_operation += 2;
         i_source_channel_offset++;
     }
+    if ( i_physical_channels & AOUT_CHAN_REARCENTER )
+    {
+        ComputeChannelOperations ( p_data , i_rate
+                , i_next_atomic_operation , i_source_channel_offset
+                , 0 , -d_z , 1.5 / i_nb_channels );
+        i_next_atomic_operation += 2;
+        i_source_channel_offset++;
+    }
     if ( i_physical_channels & AOUT_CHAN_CENTER )
     {
         ComputeChannelOperations ( p_data , i_rate
@@ -225,6 +233,22 @@ static int Init ( aout_filter_t * p_filter , struct aout_filter_sys_t * p_data
         i_next_atomic_operation += 2;
         i_source_channel_offset++;
     }
+    if ( i_physical_channels & AOUT_CHAN_MIDDLELEFT )
+    {
+        ComputeChannelOperations ( p_data , i_rate
+                , i_next_atomic_operation , i_source_channel_offset
+                , -d_x , 0 , 1.5 / i_nb_channels );
+        i_next_atomic_operation += 2;
+        i_source_channel_offset++;
+    }
+    if ( i_physical_channels & AOUT_CHAN_MIDDLERIGHT )
+    {
+        ComputeChannelOperations ( p_data , i_rate
+                , i_next_atomic_operation , i_source_channel_offset
+                , d_x , 0 , 1.5 / i_nb_channels );
+        i_next_atomic_operation += 2;
+        i_source_channel_offset++;
+    }
 
     /* Initialize the overflow buffer
      * we need it because the process induce a delay in the samples */
@@ -260,8 +284,6 @@ static int Create( vlc_object_t *p_this )
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
     if ( p_filter->output.i_physical_channels != ( AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT )
-          || (p_filter->input.i_physical_channels & AOUT_CHAN_MIDDLELEFT)
-          || (p_filter->input.i_physical_channels & AOUT_CHAN_MIDDLERIGHT)
           || p_filter->input.i_format != p_filter->output.i_format
           || p_filter->input.i_rate != p_filter->output.i_rate
           || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')