diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-05-27 10:40:37 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-05-27 10:40:37 -0300 |
commit | fa6bf06d0bc8a417de4d20da09191a12baf5b6a4 (patch) | |
tree | 13405dea17647d9e929895152fb308320ca0795c /linux/drivers/media/video/saa7134/saa7134-video.c | |
parent | e04d6d72df5f7dfbf9d9355950617c7d3a041ea0 (diff) | |
parent | e869f37a082df276cbc412d3f7da04fd3b41fed4 (diff) | |
download | mediapointer-dvb-s2-fa6bf06d0bc8a417de4d20da09191a12baf5b6a4.tar.gz mediapointer-dvb-s2-fa6bf06d0bc8a417de4d20da09191a12baf5b6a4.tar.bz2 |
merge: http://linuxtv.org/hg/~jfrancois/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-video.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c index 5f68bed54..26f1727e6 100644 --- a/linux/drivers/media/video/saa7134/saa7134-video.c +++ b/linux/drivers/media/video/saa7134/saa7134-video.c @@ -1423,11 +1423,13 @@ video_poll(struct file *file, struct poll_table_struct *wait) { struct saa7134_fh *fh = file->private_data; struct videobuf_buffer *buf = NULL; + unsigned int rc = 0; if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) return videobuf_poll_stream(file, &fh->vbi, wait); if (res_check(fh,RESOURCE_VIDEO)) { + mutex_lock(&fh->cap.vb_lock); if (!list_empty(&fh->cap.stream)) buf = list_entry(fh->cap.stream.next, struct videobuf_buffer, stream); } else { @@ -1446,13 +1448,14 @@ video_poll(struct file *file, struct poll_table_struct *wait) } if (!buf) - return POLLERR; + rc = POLLERR; poll_wait(file, &buf->done, wait); if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) - return POLLIN|POLLRDNORM; - return 0; + rc = POLLIN|POLLRDNORM; + mutex_unlock(&fh->cap.vb_lock); + return rc; err: mutex_unlock(&fh->cap.vb_lock); |