aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-fileops.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index a7f54b010a5c..38f052257f46 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -722,8 +722,8 @@ unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
722 722
723 /* If there are subscribed events, then only use the new event 723 /* If there are subscribed events, then only use the new event
724 API instead of the old video.h based API. */ 724 API instead of the old video.h based API. */
725 if (!list_empty(&id->fh.events->subscribed)) { 725 if (!list_empty(&id->fh.subscribed)) {
726 poll_wait(filp, &id->fh.events->wait, wait); 726 poll_wait(filp, &id->fh.wait, wait);
727 /* Turn off the old-style vsync events */ 727 /* Turn off the old-style vsync events */
728 clear_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags); 728 clear_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
729 if (v4l2_event_pending(&id->fh)) 729 if (v4l2_event_pending(&id->fh))
@@ -750,6 +750,7 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait)
750 struct ivtv *itv = id->itv; 750 struct ivtv *itv = id->itv;
751 struct ivtv_stream *s = &itv->streams[id->type]; 751 struct ivtv_stream *s = &itv->streams[id->type];
752 int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags); 752 int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
753 unsigned res = 0;
753 754
754 /* Start a capture if there is none */ 755 /* Start a capture if there is none */
755 if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags)) { 756 if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags)) {
@@ -769,12 +770,16 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait)
769 /* add stream's waitq to the poll list */ 770 /* add stream's waitq to the poll list */
770 IVTV_DEBUG_HI_FILE("Encoder poll\n"); 771 IVTV_DEBUG_HI_FILE("Encoder poll\n");
771 poll_wait(filp, &s->waitq, wait); 772 poll_wait(filp, &s->waitq, wait);
773 if (v4l2_event_pending(&id->fh))
774 res |= POLLPRI;
775 else
776 poll_wait(filp, &id->fh.wait, wait);
772 777
773 if (s->q_full.length || s->q_io.length) 778 if (s->q_full.length || s->q_io.length)
774 return POLLIN | POLLRDNORM; 779 return res | POLLIN | POLLRDNORM;
775 if (eof) 780 if (eof)
776 return POLLHUP; 781 return res | POLLHUP;
777 return 0; 782 return res;
778} 783}
779 784
780void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end) 785void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end)
@@ -961,10 +966,6 @@ static int ivtv_serialized_open(struct ivtv_stream *s, struct file *filp)
961 return -ENOMEM; 966 return -ENOMEM;
962 } 967 }
963 v4l2_fh_init(&item->fh, s->vdev); 968 v4l2_fh_init(&item->fh, s->vdev);
964 if (s->type == IVTV_DEC_STREAM_TYPE_YUV ||
965 s->type == IVTV_DEC_STREAM_TYPE_MPG) {
966 res = v4l2_event_alloc(&item->fh, 60);
967 }
968 if (res < 0) { 969 if (res < 0) {
969 v4l2_fh_exit(&item->fh); 970 v4l2_fh_exit(&item->fh);
970 kfree(item); 971 kfree(item);