- /* TODO: if using default device, loop through all alsa devices until
- * one works. */
- msg_Dbg( p_demux, "opening device '%s'", p_demux->p_sys->psz_device );
- if( ProbeAudioDevAlsa( p_demux, p_demux->p_sys->psz_device ) )
+ if( psz_device )
+ {
+ msg_Dbg( p_demux, "opening device '%s'", psz_device );
+ if( ProbeAudioDevAlsa( p_demux, psz_device ) )
+ {
+ msg_Dbg( p_demux, "'%s' is an audio device", psz_device );
+ OpenAudioDev( p_demux, psz_device );
+ }
+ }
+ else if( ProbeAudioDevAlsa( p_demux, ALSA_DEFAULT ) )
+ {
+ msg_Dbg( p_demux, "'%s' is an audio device", ALSA_DEFAULT );
+ OpenAudioDev( p_demux, ALSA_DEFAULT );
+ }
+ else if( ( psz_device = ListAvailableDevices( p_demux, true ) ) )