diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2011-07-13 03:03:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-27 10:41:33 -0400 |
commit | 0e17e9a9f6bfedb6aefcd88632f5d6d17c871176 (patch) | |
tree | 0ff2a1e10ffbe46248f1cc8077adcc29518f3f43 | |
parent | bf5c7cbb996d6af51f8cc18a30ffa426196bf840 (diff) |
[media] videobuf: only start streaming in poll() if so requested by the poll mask
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | 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 de4fa4eb8844..ffdf59cfe405 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, | |||
1129 | struct videobuf_queue *q, | 1129 | struct videobuf_queue *q, |
1130 | poll_table *wait) | 1130 | poll_table *wait) |
1131 | { | 1131 | { |
1132 | unsigned long req_events = poll_requested_events(wait); | ||
1132 | struct videobuf_buffer *buf = NULL; | 1133 | struct videobuf_buffer *buf = NULL; |
1133 | unsigned int rc = 0; | 1134 | unsigned int rc = 0; |
1134 | 1135 | ||
@@ -1137,7 +1138,7 @@ unsigned int videobuf_poll_stream(struct file *file, | |||
1137 | if (!list_empty(&q->stream)) | 1138 | if (!list_empty(&q->stream)) |
1138 | buf = list_entry(q->stream.next, | 1139 | buf = list_entry(q->stream.next, |
1139 | struct videobuf_buffer, stream); | 1140 | struct videobuf_buffer, stream); |
1140 | } else { | 1141 | } else if (req_events & (POLLIN | POLLRDNORM)) { |
1141 | if (!q->reading) | 1142 | if (!q->reading) |
1142 | __videobuf_read_start(q); | 1143 | __videobuf_read_start(q); |
1143 | if (!q->reading) { | 1144 | if (!q->reading) { |