[PATCH 4/6] videobuf: only start streaming in poll() if so requested by the poll mask.
- Subject: [PATCH 4/6] videobuf: only start streaming in poll() if so requested by the poll mask.
- From: Hans Verkuil <hverkuil@xxxxxxxxx>
- Date: Fri, 3 Feb 2012 10:28:43 +0100
- Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Davide Libenzi <davidel@xxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>, Enke Chen <enkechen@xxxxxxxxx>, Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>, Hans Verkuil <hans.verkuil@xxxxxxxxx>
- In-reply-to: <1328261325-8452-1-git-send-email-hverkuil@xs4all.nl>
- In-reply-to: <0a2613f950f1865c6c2675c27186e73a8c3dfe94.1328260650.git.hans.verkuil@cisco.com>
From: Hans Verkuil <hans.verkuil@xxxxxxxxx>
Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>
---
drivers/media/video/videobuf-core.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c
index de4fa4e..ffdf59c 100644
--- a/drivers/media/video/videobuf-core.c
+++ b/drivers/media/video/videobuf-core.c
@@ -1129,6 +1129,7 @@ unsigned int videobuf_poll_stream(struct file *file,
struct videobuf_queue *q,
poll_table *wait)
{
+ unsigned long req_events = poll_requested_events(wait);
struct videobuf_buffer *buf = NULL;
unsigned int rc = 0;
@@ -1137,7 +1138,7 @@ unsigned int videobuf_poll_stream(struct file *file,
if (!list_empty(&q->stream))
buf = list_entry(q->stream.next,
struct videobuf_buffer, stream);
- } else {
+ } else if (req_events & (POLLIN | POLLRDNORM)) {
if (!q->reading)
__videobuf_read_start(q);
if (!q->reading) {
--
1.7.8.3
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Input]
[Video for Linux]
[Mplayer Users]
[Linux USB Devel]
[Linux Audio Users]
[Photos]
[Yosemite Photos]
[Linux Kernel]
[Linux SCSI]
[XFree86]
[Devices]
[Yosemite Backpacking]