]> git.sesse.net Git - vlc/commitdiff
ALSA: use default device if none specified instead of failing
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 18 Jul 2010 15:59:59 +0000 (18:59 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 18 Jul 2010 16:09:40 +0000 (19:09 +0300)
modules/audio_output/alsa.c

index 146e11d802ea34e4fc153c8b73db18ff01e576d6..af87d42f7a89a011a1d62983eb73b5d2a427cefd 100644 (file)
@@ -345,14 +345,15 @@ static int Open( vlc_object_t *p_this )
         return VLC_ENOMEM;
 
     /* Get device name */
-    if( (psz_device = var_InheritString( p_aout, "alsa-audio-device" )) == NULL )
+    psz_device = var_InheritString( p_aout, "alsa-audio-device" );
+    if( unlikely(psz_device == NULL) )
     {
-        msg_Err( p_aout, "no audio device given (maybe \"default\" ?)" );
-        dialog_Fatal( p_aout, _("No Audio Device"), "%s",
-                        _("No audio device name was given. You might want to " \
-                          "enter \"default\".") );
-        free( p_sys );
-        return VLC_EGENERIC;
+        psz_device = strdup( DEFAULT_ALSA_DEVICE );
+        if( unlikely(psz_device == NULL) )
+        {
+            free( p_sys );
+            return VLC_ENOMEM;
+        }
     }
 
     /* Choose the IEC device for S/PDIF output: