[vlc-commits] commit: Workaround v4l2 drivers that do not behave correctly while enumerating inputs , standard, tuner, or format. (Laurent Aimar )
git at videolan.org
git at videolan.org
Sun Nov 7 16:45:29 CET 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Nov 7 16:39:15 2010 +0100| [9c5eda2458861251c66eb11e3f811f60f1d69a2a] | committer: Laurent Aimar
Workaround v4l2 drivers that do not behave correctly while enumerating inputs, standard, tuner, or format.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c5eda2458861251c66eb11e3f811f60f1d69a2a
---
modules/access/v4l2.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c
index a97aa53..7fbd04b 100644
--- a/modules/access/v4l2.c
+++ b/modules/access/v4l2.c
@@ -2491,6 +2491,8 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys,
p_sys->i_input = 0;
while( v4l2_ioctl( i_fd, VIDIOC_ENUMINPUT, &t_input ) >= 0 )
{
+ if( t_input.index != p_sys->i_input )
+ break;
p_sys->i_input++;
t_input.index = p_sys->i_input;
}
@@ -2527,6 +2529,8 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys,
p_sys->i_standard = 0;
while( v4l2_ioctl( i_fd, VIDIOC_ENUMSTD, &t_standards ) >=0 )
{
+ if( t_standards.index != p_sys->i_standard )
+ break;
p_sys->i_standard++;
t_standards.index = p_sys->i_standard;
}
@@ -2592,6 +2596,8 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys,
p_sys->i_tuner = 0;
while( v4l2_ioctl( i_fd, VIDIOC_G_TUNER, &tuner ) >= 0 )
{
+ if( tuner.index != p_sys->i_tuner )
+ break;
p_sys->i_tuner++;
memset( &tuner, 0, sizeof(tuner) );
tuner.index = p_sys->i_tuner;
@@ -2655,6 +2661,8 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys,
while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FMT, &codec ) >= 0 )
{
+ if( codec.index != i_index )
+ break;
i_index++;
codec.index = i_index;
}
More information about the vlc-commits
mailing list