comparison stream/tvi_v4l2.c @ 28927:8f7c8a1cb8b7

100l fix calculation of dropped frames, number of frames is time * fps, not time / fps.
author reimar
date Sun, 15 Mar 2009 16:12:05 +0000
parents 4932a522100e
children 7406e7f30d4e
comparison
equal deleted inserted replaced
28926:241cb573f68b 28927:8f7c8a1cb8b7
1124 1124
1125 if (priv->streamon) { 1125 if (priv->streamon) {
1126 struct v4l2_buffer buf; 1126 struct v4l2_buffer buf;
1127 1127
1128 /* get performance */ 1128 /* get performance */
1129 frames = 1 + lrintf((double)(priv->curr_frame - priv->first_frame) / (1e6 * getfps(priv))); 1129 frames = 1 + lrintf((double)(priv->curr_frame - priv->first_frame) / 1e6 * getfps(priv));
1130 dropped = frames - priv->frames; 1130 dropped = frames - priv->frames;
1131 1131
1132 /* turn off streaming */ 1132 /* turn off streaming */
1133 if (ioctl(priv->video_fd, VIDIOC_STREAMOFF, &(priv->map[0].buf.type)) < 0) { 1133 if (ioctl(priv->video_fd, VIDIOC_STREAMOFF, &(priv->map[0].buf.type)) < 0) {
1134 mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl streamoff failed: %s\n", 1134 mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl streamoff failed: %s\n",