]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] ivtv: only start streaming in poll() if polling for input
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 13 Jul 2011 09:08:22 +0000 (06:08 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 26 Nov 2011 15:39:06 +0000 (13:39 -0200)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/ivtv/ivtv-fileops.c

index 38f052257f4620498d6b23e0bf3b7cfb88aa5ba9..a931ecf703637b9e7de52cab604002d46b12082a 100644 (file)
@@ -744,8 +744,9 @@ unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
        return res;
 }
 
-unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait)
+unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
 {
+       unsigned long req_events = poll_requested_events(wait);
        struct ivtv_open_id *id = fh2id(filp->private_data);
        struct ivtv *itv = id->itv;
        struct ivtv_stream *s = &itv->streams[id->type];
@@ -753,7 +754,8 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait)
        unsigned res = 0;
 
        /* Start a capture if there is none */
-       if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags)) {
+       if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags) &&
+                       (req_events & (POLLIN | POLLRDNORM))) {
                int rc;
 
                mutex_lock(&itv->serialize_lock);