Commit 293ed14d authored by Thierry Reding's avatar Thierry Reding Committed by Jean-Baptiste Kempf

V4L2: Set standard prior to tuner frequency.

Some V4L2 devices (e.g. Hauppauge EXETER boards) compute the tuner
frequency depending on the configured standard, so the standard needs to
be set first.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3311fb12
......@@ -1851,6 +1851,32 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, bool b_demux )
}
#endif
/* Select standard */
if( p_sys->i_selected_standard_id != V4L2_STD_UNKNOWN )
{
if( v4l2_ioctl( i_fd, VIDIOC_S_STD, &p_sys->i_selected_standard_id ) < 0 )
{
msg_Err( p_obj, "cannot set standard (%m)" );
goto open_failed;
}
if( v4l2_ioctl( i_fd, VIDIOC_G_STD, &p_sys->i_selected_standard_id ) < 0 )
{
msg_Err( p_obj, "cannot get standard (%m). This should never happen!" );
goto open_failed;
}
msg_Dbg( p_obj, "Set standard to (0x%"PRIx64"):", p_sys->i_selected_standard_id );
int i_standard;
for( i_standard = 0; i_standard<p_sys->i_standard; i_standard++)
{
if( p_sys->p_standards[i_standard].id & p_sys->i_selected_standard_id )
{
msg_Dbg( p_obj, " %s",
p_sys->p_standards[i_standard].name );
}
}
}
/* Tune the tuner */
if( p_sys->i_frequency >= 0 )
{
......@@ -1892,32 +1918,6 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, bool b_demux )
msg_Dbg( p_obj, "Tuner audio mode set" );
}
/* Select standard */
if( p_sys->i_selected_standard_id != V4L2_STD_UNKNOWN )
{
if( v4l2_ioctl( i_fd, VIDIOC_S_STD, &p_sys->i_selected_standard_id ) < 0 )
{
msg_Err( p_obj, "cannot set standard (%m)" );
goto open_failed;
}
if( v4l2_ioctl( i_fd, VIDIOC_G_STD, &p_sys->i_selected_standard_id ) < 0 )
{
msg_Err( p_obj, "cannot get standard (%m). This should never happen!" );
goto open_failed;
}
msg_Dbg( p_obj, "Set standard to (0x%"PRIx64"):", p_sys->i_selected_standard_id );
int i_standard;
for( i_standard = 0; i_standard<p_sys->i_standard; i_standard++)
{
if( p_sys->p_standards[i_standard].id & p_sys->i_selected_standard_id )
{
msg_Dbg( p_obj, " %s",
p_sys->p_standards[i_standard].name );
}
}
}
/* Select input */
if( p_sys->i_selected_input >= p_sys->i_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