diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-11 02:20:39 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-11 02:20:39 +0000 |
commit | b123c29e900602738e05302c74a6f142b7920bcb (patch) | |
tree | d28e7617f5c68b7e3566f954991b1a7d8d749c9a /libmpdemux | |
parent | 7906e70c058c8c4452766dc24bf78db28be44ccb (diff) |
doublebuffeing SYNC fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2815 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/tvi_v4l.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libmpdemux/tvi_v4l.c b/libmpdemux/tvi_v4l.c index 7f35973f13..a869ffff08 100644 --- a/libmpdemux/tvi_v4l.c +++ b/libmpdemux/tvi_v4l.c @@ -657,19 +657,20 @@ static int control(priv_t *priv, int cmd, void *arg) static int grab_video_frame(priv_t *priv, char *buffer, int len) { int frame = priv->queue % priv->nbuf; + int nextframe = (priv->queue+1) % priv->nbuf; printf("grab_video_frame(priv=%p, buffer=%p, len=%d\n", priv, buffer, len); printf("buf: %p + frame: %d => %p\n", - priv->buf, frame, &priv->buf[frame]); - if (ioctl(priv->fd, VIDIOCMCAPTURE, &priv->buf[frame]) == -1) + priv->buf, nextframe, &priv->buf[nextframe]); + if (ioctl(priv->fd, VIDIOCMCAPTURE, &priv->buf[nextframe]) == -1) { printf("ioctl mcapture failed: %s\n", strerror(errno)); return(0); } - if (ioctl(priv->fd, VIDIOCSYNC, &priv->buf[frame]) == -1) + if (ioctl(priv->fd, VIDIOCSYNC, &priv->buf[frame].frame) == -1) printf("ioctl sync failed: %s\n", strerror(errno)); priv->queue++; |