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,16 +1897,23 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, vlc_bool_t b_d ...@@ -1897,16 +1897,23 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, vlc_bool_t b_d
goto open_failed; goto open_failed;
} }
if( p_sys->i_selected_audio_input >= p_sys->i_audio ) /* Set audio input */
{
msg_Warn( p_obj, "invalid audio input. Using the default one" );
p_sys->i_selected_audio_input = 0;
}
if( ioctl( i_fd, VIDIOC_S_AUDIO, &p_sys->p_audios[p_sys->i_selected_audio_input] ) < 0 ) if( p_sys->i_audio > 0 )
{ {
msg_Err( p_obj, "cannot set audio input (%m)" ); if( p_sys->i_selected_audio_input < 0
goto open_failed; || 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;
}
if( ioctl( i_fd, VIDIOC_S_AUDIO, &p_sys->p_audios[p_sys->i_selected_audio_input] ) < 0 )
{
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 );
} }
......
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