summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-06-30 17:46:27 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-06-30 17:46:27 +0000
commit6077530ac232800f17de966a9c5e146c9e6dee54 (patch)
tree2ae070f800a76235122b252ff88a456b8e682eea /stream
parentfddbd849924748088d719d0289b768a493d0be9e (diff)
downloadmpv-6077530ac232800f17de966a9c5e146c9e6dee54.tar.bz2
mpv-6077530ac232800f17de966a9c5e146c9e6dee54.tar.xz
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27171 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/tvi_v4l2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index c188da92a4..97bce47754 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -448,6 +448,18 @@ static int getstd(priv_t *priv)
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;