# HG changeset patch # User voroshil # Date 1214847987 0 # Node ID 0917bf2bed6c24f96b4964b920d7f1c0bcbf7a87 # Parent 62916b06a055dde6c7c2e980a47b9a5dacec10f6 Try to get frame rate information through VIDIOC_G_PARM if capture device driver (such as uvcvideo USB video driver) does not provide VIDIOC_G_STD ioctl. diff -r 62916b06a055 -r 0917bf2bed6c stream/tvi_v4l2.c --- a/stream/tvi_v4l2.c Mon Jun 30 17:42:35 2008 +0000 +++ b/stream/tvi_v4l2.c Mon Jun 30 17:46:27 2008 +0000 @@ -448,6 +448,18 @@ int i=0; if (ioctl(priv->video_fd, VIDIOC_G_STD, &id) < 0) { + struct v4l2_streamparm parm; + + parm.type=V4L2_BUF_TYPE_VIDEO_CAPTURE; + if(ioctl(priv->video_fd, VIDIOC_G_PARM, &parm) >= 0) { + mp_msg(MSGT_TV, MSGL_WARN, "%s: your device driver does not support VIDIOC_G_STD ioctl," + " VIDIOC_G_PARM was used instead.\n", info.short_name); + priv->standard.index=0; + priv->standard.id=0; + priv->standard.frameperiod=parm.parm.capture.timeperframe; + return 0; + } + mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl get standard failed: %s\n", info.short_name, strerror(errno)); return -1;