mirror of
https://github.com/mpv-player/mpv
synced 2024-12-29 10:32:15 +00:00
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
This commit is contained in:
parent
2c0e1c6089
commit
ec27ebf6b7
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user