diff options
author | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-29 23:10:08 +0000 |
---|---|---|
committer | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-29 23:10:08 +0000 |
commit | ec27ebf6b7ae96b7ba0897075cb0adfc63679587 (patch) | |
tree | bda698cc0e76277b94eb7fbc453de45088b3c3af /libmpdemux | |
parent | 2c0e1c608959443e47c46b6002ac57345a2a3f2f (diff) | |
download | mpv-ec27ebf6b7ae96b7ba0897075cb0adfc63679587.tar.bz2 mpv-ec27ebf6b7ae96b7ba0897075cb0adfc63679587.tar.xz |
allow utilization of more v4l buffers, patch by Carsten Schulz <carsten@gnocchi.dialup.fu-berlin.de>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8651 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/tvi_v4l.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/libmpdemux/tvi_v4l.c b/libmpdemux/tvi_v4l.c index 771d36346d..ac2cac401d 100644 --- a/libmpdemux/tvi_v4l.c +++ b/libmpdemux/tvi_v4l.c @@ -1224,19 +1224,19 @@ static void *video_grabber(void *data) priv_t *priv = (priv_t*)data; struct timeval curtime; long long skew, prev_skew, xskew, interval, prev_interval; - int frame, nextframe; + int frame; int i; int first = 1; int framecount; /* start the capture process */ - if (ioctl(priv->video_fd, VIDIOCMCAPTURE, &priv->buf[0]) == -1) - { - mp_msg(MSGT_TV, MSGL_ERR, "\nioctl mcapture failed: %s\n", strerror(errno)); + + for (i=0; i < priv->nbuf; i++) { + if (ioctl(priv->video_fd, VIDIOCMCAPTURE, &priv->buf[i]) == -1) + { + mp_msg(MSGT_TV, MSGL_ERR, "\nioctl mcapture failed: %s\n", strerror(errno)); + } } - while (ioctl(priv->video_fd, VIDIOCSYNC, &priv->buf[1].frame) < 0 && - (errno == EAGAIN || errno == EINTR)); - mp_dbg(MSGT_TV, MSGL_DBG3, "\npicture sync failed\n"); prev_interval = 0; prev_skew = 0; @@ -1255,14 +1255,7 @@ static void *video_grabber(void *data) } frame = i; - nextframe = (i+1)%priv->nbuf; - - if (ioctl(priv->video_fd, VIDIOCMCAPTURE, &priv->buf[nextframe]) == -1) - { - mp_msg(MSGT_TV, MSGL_ERR, "\nioctl mcapture failed: %s\n", strerror(errno)); - continue; - } - + while (ioctl(priv->video_fd, VIDIOCSYNC, &priv->buf[frame].frame) < 0 && (errno == EAGAIN || errno == EINTR)); mp_dbg(MSGT_TV, MSGL_DBG3, "\npicture sync failed\n"); @@ -1355,6 +1348,12 @@ static void *video_grabber(void *data) priv->video_cnt++; } + if (ioctl(priv->video_fd, VIDIOCMCAPTURE, &priv->buf[frame]) == -1) + { + mp_msg(MSGT_TV, MSGL_ERR, "\nioctl mcapture failed: %s\n", strerror(errno)); + continue; + } + } } |