]> git.sesse.net Git - vlc/commitdiff
Support up to 9 channel with Vorbis
authorRémi Denis-Courmont <rem@videolan.org>
Fri, 31 Aug 2007 15:54:20 +0000 (15:54 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Fri, 31 Aug 2007 15:54:20 +0000 (15:54 +0000)
Patch from Pierre-Luc Beaudoin

THANKS
modules/codec/vorbis.c

diff --git a/THANKS b/THANKS
index cb4a62ee54b9d779fb68e5971b7674aaa081ed93..82b53b050ab137b11396a1f55f4c9fa85973c9bb 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -162,7 +162,8 @@ Paul Mackerras <paulus at linuxcare.com.au> - AltiVec IDCT and motion
 Pavlov Konstantin “thresh” - several Linux build system fixes
 Petr Vacek - FTP cleartext authentication
 Philippe Van Hecke <philippe at belnet dot be> - SAP header hash patch
-Pierre d'Herbemont <<pdherbemont at free dot fr> - Compile fix
+Pierre d'Herbemont <pdherbemont at free dot fr> - Compile fix
+Pierre-Luc Beaudoin - Vorbis 9 channels patch
 Pierre Marc Dumuid <pierre.dumuid at adelaide dot edu dot au> - Playlist patches
 Pittayakom Saingtong <develop5 qt datawiz dot co dot th> - Thai localisation
 Rafaël Carré <funman at videolan org> - Audioscrobbler plugin, D-Bus control
index 3efb2e7954da6f86c27fc4cb9e2472158b3434a0..5bfdd5e1782aba3a14b270f8a8af2ebedc0997fb 100644 (file)
@@ -1,7 +1,10 @@
 /*****************************************************************************
- * vorbis.c: vorbis decoder/encoder/packetizer module making use of libvorbis.
+ * vorbis.c: vorbis decoder/encoder/packetizer module using of libvorbis.
  *****************************************************************************
  * Copyright (C) 2001-2003 the VideoLAN team
+ * Copyright (C) 2007 Société des arts technologiques
+ * Copyright (C) 2007 Savoir-faire Linux
+ *
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
@@ -86,7 +89,7 @@ struct decoder_sys_t
     int pi_chan_table[AOUT_CHAN_MAX];
 };
 
-static int pi_channels_maps[7] =
+static int pi_channels_maps[9] =
 {
     0,
     AOUT_CHAN_CENTER,
@@ -97,7 +100,13 @@ static int pi_channels_maps[7] =
     AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
      | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT,
     AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
-     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE
+     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT
+     | AOUT_CHAN_MIDDLERIGHT,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT
+     | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT
+     | AOUT_CHAN_LFE 
 };
 
 /*
@@ -395,10 +404,9 @@ static int ProcessHeaders( decoder_t *p_dec )
     p_dec->fmt_out.audio.i_rate     = p_sys->vi.rate;
     p_dec->fmt_out.audio.i_channels = p_sys->vi.channels;
 
-    if( p_dec->fmt_out.audio.i_channels < 0 ||
-        p_dec->fmt_out.audio.i_channels > 6 )
+    if( p_dec->fmt_out.audio.i_channels > 9 )
     {
-        msg_Err( p_dec, "invalid number of channels (not between 1 and 6): %i",
+        msg_Err( p_dec, "invalid number of channels (not between 1 and 9): %i",
                  p_dec->fmt_out.audio.i_channels );
         return VLC_EGENERIC;
     }
@@ -409,7 +417,6 @@ static int ProcessHeaders( decoder_t *p_dec )
     p_dec->fmt_out.i_bitrate = p_sys->vi.bitrate_nominal;
 
     aout_DateInit( &p_sys->end_date, p_sys->vi.rate );
-    aout_DateSet( &p_sys->end_date, 0 );
 
     msg_Dbg( p_dec, "channels:%d samplerate:%ld bitrate:%ld",
              p_sys->vi.channels, p_sys->vi.rate, p_sys->vi.bitrate_nominal );