From: Hans Verkuil Date: Wed, 13 Jul 2011 09:08:22 +0000 (+0200) Subject: ivtv: only start streaming in poll() if polling for input. X-Git-Tag: next-20111109~39^2^2~11 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0b20dd0099d017ab04e170988869fa01a78adeaf;p=karo-tx-linux.git ivtv: only start streaming in poll() if polling for input. Signed-off-by: Hans Verkuil Acked-by: Andy Walls --- diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index 38f052257f46..a931ecf70363 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c @@ -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);