[vlc-commits] simple mixer: unduplicate channels definitions

Rémi Denis-Courmont git at videolan.org
Thu Mar 8 20:49:57 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Mar  8 21:49:38 2012 +0200| [fc247b6f842e382484486197f89beca34499e425] | committer: Rémi Denis-Courmont

simple mixer: unduplicate channels definitions

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc247b6f842e382484486197f89beca34499e425
---

 include/vlc_es.h                            |   21 ++++++++++++++++-----
 modules/audio_filter/channel_mixer/simple.c |   14 --------------
 2 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index 94fe30d..21d7724 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -109,13 +109,24 @@ struct audio_format_t
 #define AOUT_CHANS_FRONT  (AOUT_CHAN_LEFT       | AOUT_CHAN_RIGHT)
 #define AOUT_CHANS_MIDDLE (AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT)
 #define AOUT_CHANS_REAR   (AOUT_CHAN_REARLEFT   | AOUT_CHAN_REARRIGHT)
+#define AOUT_CHANS_CENTER (AOUT_CHAN_CENTER     | AOUT_CHAN_REARCENTER)
 
-#define AOUT_CHANS_STEREO (AOUT_CHANS_FRONT)
+#define AOUT_CHANS_STEREO AOUT_CHANS_2_0
+#define AOUT_CHANS_2_0    (AOUT_CHANS_FRONT)
+#define AOUT_CHANS_2_1    (AOUT_CHANS_FRONT | AOUT_CHAN_LFE)
+#define AOUT_CHANS_3_0    (AOUT_CHANS_FRONT | AOUT_CHAN_CENTER)
+#define AOUT_CHANS_3_1    (AOUT_CHANS_3_0   | AOUT_CHAN_LFE)
 #define AOUT_CHANS_4_0    (AOUT_CHANS_FRONT | AOUT_CHANS_REAR)
-#define AOUT_CHANS_4_1    (AOUT_CHANS_4_0 | AOUT_CHAN_LFE)
-#define AOUT_CHANS_5_0    (AOUT_CHANS_4_0 | AOUT_CHAN_CENTER)
-#define AOUT_CHANS_5_1    (AOUT_CHANS_5_0 | AOUT_CHAN_LFE)
-#define AOUT_CHANS_7_1    (AOUT_CHANS_5_1 | AOUT_CHANS_MIDDLE)
+#define AOUT_CHANS_4_1    (AOUT_CHANS_4_0   | AOUT_CHAN_LFE)
+#define AOUT_CHANS_5_0    (AOUT_CHANS_4_0   | AOUT_CHAN_CENTER)
+#define AOUT_CHANS_5_1    (AOUT_CHANS_5_0   | AOUT_CHAN_LFE)
+#define AOUT_CHANS_6_0    (AOUT_CHANS_4_0   | AOUT_CHANS_MIDDLE)
+#define AOUT_CHANS_7_0    (AOUT_CHANS_6_0   | AOUT_CHAN_CENTER)
+#define AOUT_CHANS_7_1    (AOUT_CHANS_5_1   | AOUT_CHANS_MIDDLE)
+
+#define AOUT_CHANS_4_0_MIDDLE (AOUT_CHANS_FRONT | AOUT_CHANS_MIDDLE)
+#define AOUT_CHANS_4_CENTER_REAR (AOUT_CHANS_FRONT | AOUT_CHANS_CENTER)
+#define AOUT_CHANS_5_0_MIDDLE (AOUT_CHANS_4_0_MIDDLE | AOUT_CHAN_CENTER)
 
 /* Values available for original channels only */
 #define AOUT_CHAN_DOLBYSTEREO       0x10000
diff --git a/modules/audio_filter/channel_mixer/simple.c b/modules/audio_filter/channel_mixer/simple.c
index 45ea41a..b48eede 100644
--- a/modules/audio_filter/channel_mixer/simple.c
+++ b/modules/audio_filter/channel_mixer/simple.c
@@ -51,20 +51,6 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-#define AOUT_CHANS_STEREO_FRONT  ( AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT )
-#define AOUT_CHANS_STEREO_REAR   ( AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT )
-#define AOUT_CHANS_STEREO_MIDDLE (AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT )
-
-#define AOUT_CHANS_2_0          AOUT_CHANS_STEREO_FRONT
-#define AOUT_CHANS_3_0          ( AOUT_CHANS_STEREO_FRONT | AOUT_CHAN_CENTER )
-#define AOUT_CHANS_4_0          ( AOUT_CHANS_STEREO_FRONT | AOUT_CHANS_STEREO_REAR )
-#define AOUT_CHANS_4_0_MIDDLE   ( AOUT_CHANS_STEREO_FRONT | AOUT_CHANS_STEREO_MIDDLE )
-#define AOUT_CHANS_4_CENTER_REAR (AOUT_CHANS_STEREO_FRONT | AOUT_CHAN_CENTER | AOUT_CHAN_REARCENTER)
-#define AOUT_CHANS_5_0          ( AOUT_CHANS_4_0 | AOUT_CHAN_CENTER )
-#define AOUT_CHANS_5_0_MIDDLE   ( AOUT_CHANS_4_0_MIDDLE | AOUT_CHAN_CENTER )
-#define AOUT_CHANS_6_0          ( AOUT_CHANS_STEREO_FRONT | AOUT_CHANS_STEREO_REAR | AOUT_CHANS_STEREO_MIDDLE )
-#define AOUT_CHANS_7_0          ( AOUT_CHANS_6_0 | AOUT_CHAN_CENTER )
-
 static bool IsSupported( const audio_format_t *p_input, const audio_format_t *p_output );
 
 static block_t *Filter( filter_t *, block_t * );



More information about the vlc-commits mailing list