Skip to content

Commit

Permalink
[media] au0828: enable VBI timeout when calling read() without stream…
Browse files Browse the repository at this point in the history
…on()

Because some clients (e.g. tvtime) will just open the filehandle and call
read() instead of explicitly calling streamon first, we need to make sure the
VBI timeout routine gets enabled in this case.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Dec 29, 2010
1 parent 78ca500 commit bf79716
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/media/video/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,13 @@ static ssize_t au0828_v4l2_read(struct file *filp, char __user *buf,
if (!res_get(fh, AU0828_RESOURCE_VBI))
return -EBUSY;

if (dev->vbi_timeout_running == 0) {
/* Handle case where caller tries to read without
calling streamon first */
dev->vbi_timeout_running = 1;
mod_timer(&dev->vbi_timeout, jiffies + (HZ / 10));
}

return videobuf_read_stream(&fh->vb_vbiq, buf, count, pos, 0,
filp->f_flags & O_NONBLOCK);
}
Expand Down

0 comments on commit bf79716

Please sign in to comment.