]> git.sesse.net Git - vlc/commitdiff
* modules/audio_output/alsa.c: Fixed mono files output (thanks bozo !),
authorChristophe Massiot <massiot@videolan.org>
Mon, 10 Feb 2003 17:43:21 +0000 (17:43 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 10 Feb 2003 17:43:21 +0000 (17:43 +0000)
* Minor fixes.

modules/audio_output/alsa.c
modules/audio_output/oss.c

index 8d4c78ff481a932394951180bd6d16542586a28e..79adf8ed2e834fe358bf7441c967a58243f1b528 100644 (file)
@@ -2,7 +2,7 @@
  * alsa.c : alsa plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: alsa.c,v 1.21 2003/02/03 00:39:42 sam Exp $
+ * $Id: alsa.c,v 1.22 2003/02/10 17:43:21 massiot Exp $
  *
  * Authors: Henri Fallon <henri@videolan.org> - Original Author
  *          Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
@@ -159,7 +159,7 @@ static void Probe( aout_instance_t * p_aout,
 
         i_channels = aout_FormatNbChannels( &p_aout->output.output );
 
-        while ( i_channels > 1 )
+        while ( i_channels > 0 )
         {
             /* Here we have to probe multi-channel capabilities but I have
                no idea (at the moment) of how its managed by the ALSA
@@ -342,6 +342,15 @@ static int Open( vlc_object_t *p_this )
         p_aout->output.output.i_physical_channels = AOUT_CHAN_CENTER;
     }
 
+    else
+    {
+        /* This should not happen ! */
+        msg_Err( p_aout, "internal: can't find audio-device (%s)",
+                 val.psz_string );
+        free( p_sys );
+        free( val.psz_string );
+        return VLC_EGENERIC;
+    }
     free( val.psz_string );
 
 #ifdef DEBUG
index 1fff18229f551ff5ddf11ffc130c3293ff542564..8d7005e9749b4dbbdde8d9f047b0cd9254e60eb5 100644 (file)
@@ -2,7 +2,7 @@
  * oss.c : OSS /dev/dsp module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2002 VideoLAN
- * $Id: oss.c,v 1.50 2003/02/06 15:14:41 massiot Exp $
+ * $Id: oss.c,v 1.51 2003/02/10 17:43:21 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -331,6 +331,7 @@ static int Open( vlc_object_t *p_this )
         msg_Err( p_aout, "internal: can't find audio-device (%s)",
                  val.psz_string );
         free( p_sys );
+        free( val.psz_string );
         return VLC_EGENERIC;
     }
     free( val.psz_string );