Commit 836f9311 authored by Antoine Cellerier's avatar Antoine Cellerier

Don't try setting the audio input source if the v4l2 device doesn't have any.

parent 29e5b0fa
......@@ -1897,7 +1897,12 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, vlc_bool_t b_d
goto open_failed;
}
if( p_sys->i_selected_audio_input >= p_sys->i_audio )
/* Set audio input */
if( p_sys->i_audio > 0 )
{
if( p_sys->i_selected_audio_input < 0
|| p_sys->i_selected_audio_input >= p_sys->i_audio )
{
msg_Warn( p_obj, "invalid audio input. Using the default one" );
p_sys->i_selected_audio_input = 0;
......@@ -1908,6 +1913,8 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, vlc_bool_t b_d
msg_Err( p_obj, "cannot set audio input (%m)" );
goto open_failed;
}
msg_Dbg( p_obj, "Audio input set to %d", p_sys->i_selected_audio_input );
}
/* TODO: Move the resolution stuff up here */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment