[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l.c,1.3,1.4

Arpi of Ize arpi at mplayer.dev.hu
Sun Nov 11 03:20:42 CET 2001


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv4009

Modified Files:
	tvi_v4l.c 
Log Message:
doublebuffeing SYNC fixed

Index: tvi_v4l.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- tvi_v4l.c	11 Nov 2001 01:44:54 -0000	1.3
+++ tvi_v4l.c	11 Nov 2001 02:20:39 -0000	1.4
@@ -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++;
     




More information about the MPlayer-cvslog mailing list