Skip to content

Commit

Permalink
[media] ivtv: only start streaming in poll() if polling for input
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 27, 2012
1 parent 50953e0 commit d0b66fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/video/ivtv/ivtv-fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,16 +746,18 @@ 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];
int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
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;

rc = ivtv_start_capture(id);
Expand Down

0 comments on commit d0b66fd

Please sign in to comment.