]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] videobuf: only start streaming in poll() if so requested by the poll mask
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 13 Jul 2011 07:03:52 +0000 (04:03 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 27 Mar 2012 14:41:33 +0000 (11:41 -0300)
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>
drivers/media/video/videobuf-core.c

index de4fa4eb8844b3b77f82ae8344633e1201e38ad3..ffdf59cfe4054f18d258ec4d682fddcfc7dc1aa7 100644 (file)
@@ -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) {