[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l.c,1.47,1.48
Jindrich Makovicka CVS
henry at mplayerhq.hu
Mon Dec 30 00:10:22 CET 2002
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv22156
Modified Files:
tvi_v4l.c
Log Message:
allow utilization of more v4l buffers, patch by Carsten Schulz <carsten at gnocchi.dialup.fu-berlin.de>
Index: tvi_v4l.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- tvi_v4l.c 28 Dec 2002 22:57:39 -0000 1.47
+++ tvi_v4l.c 29 Dec 2002 23:10:08 -0000 1.48
@@ -1224,19 +1224,19 @@
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 @@
}
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");
@@ -1353,6 +1346,12 @@
copy_frame(priv, priv->video_ringbuffer[priv->video_tail], priv->mmap+priv->mbuf.offsets[frame]);
priv->video_tail = (priv->video_tail+1)%priv->video_buffer_size_current;
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;
}
}
More information about the MPlayer-cvslog
mailing list