# HG changeset patch # User arpi # Date 1005445239 0 # Node ID 37fc45a05082bc673f90706390c7da0c5acca23a # Parent d6d88771f5ef9e8d9c4a959e0f9d779f9cd6a926 doublebuffeing SYNC fixed diff -r d6d88771f5ef -r 37fc45a05082 libmpdemux/tvi_v4l.c --- a/libmpdemux/tvi_v4l.c Sun Nov 11 02:04:41 2001 +0000 +++ b/libmpdemux/tvi_v4l.c Sun Nov 11 02:20:39 2001 +0000 @@ -657,19 +657,20 @@ 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++;