ALSA: use plughw rather than hw for manually selected output
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 18 Jul 2010 15:46:07 +0000 (18:46 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 18 Jul 2010 15:52:07 +0000 (18:52 +0300)
plughw provides transparent userspace format conversion if needed.
That is much safer. In fact, I doubt VLC would support all raw hardware
drivers - some have rather weird format requirements.

modules/audio_output/alsa.c

index 62693b3..146e11d 100644 (file)
@@ -1005,13 +1005,13 @@ static void GetDevicesForCard( vlc_object_t *obj, module_config_t *p_item,
             continue;
         }
 
-        if( asprintf( &psz_device, "hw:%d,%d", i_card, i_pcm_device ) == -1 )
-            break;
+        if( asprintf( &psz_device, "plughw:%u,%u", i_card, i_pcm_device ) == -1 )
+            continue;
         if( asprintf( &psz_descr, "%s: %s (%s)", psz_card_name,
                   snd_pcm_info_get_name(p_pcm_info), psz_device ) == -1 )
         {
             free( psz_device );
-            break;
+            continue;
         }
 
         msg_Dbg( obj, "  %s", psz_descr );