diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-08-23 16:51:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:06:49 -0400 |
commit | 559e196a56a5d518181efc1d2fefe0892f4689b4 (patch) | |
tree | 99de577c399d281b6d599ec9a7ba6ddb0a148780 /drivers/media/video/ivtv/ivtv-streams.c | |
parent | a158f3559334c6314c7876390caffe88c9fdb64d (diff) |
V4L/DVB (6096): ivtv: fix V4L2_ENC_CMD_STOP_AT_GOP_END support
Support for V4L2_ENC_CMD_STOP_AT_GOP_END was broken. While the driver
correctly waited for the card to capture until the GOP was complete,
afterwards the driver buffers were just flushed instead of waiting
for the application to read all the pending data.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-streams.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-streams.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index e05af62a8cd5..a3296224f821 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -719,7 +719,6 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end) | |||
719 | struct ivtv *itv = s->itv; | 719 | struct ivtv *itv = s->itv; |
720 | DECLARE_WAITQUEUE(wait, current); | 720 | DECLARE_WAITQUEUE(wait, current); |
721 | int cap_type; | 721 | int cap_type; |
722 | unsigned long then; | ||
723 | int stopmode; | 722 | int stopmode; |
724 | 723 | ||
725 | if (s->v4l2dev == NULL) | 724 | if (s->v4l2dev == NULL) |
@@ -762,14 +761,12 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end) | |||
762 | /* when: 0 = end of GOP 1 = NOW!, type: 0 = mpeg, subtype: 3 = video+audio */ | 761 | /* when: 0 = end of GOP 1 = NOW!, type: 0 = mpeg, subtype: 3 = video+audio */ |
763 | ivtv_vapi(itv, CX2341X_ENC_STOP_CAPTURE, 3, stopmode, cap_type, s->subtype); | 762 | ivtv_vapi(itv, CX2341X_ENC_STOP_CAPTURE, 3, stopmode, cap_type, s->subtype); |
764 | 763 | ||
765 | then = jiffies; | ||
766 | |||
767 | if (!test_bit(IVTV_F_S_PASSTHROUGH, &s->s_flags)) { | 764 | if (!test_bit(IVTV_F_S_PASSTHROUGH, &s->s_flags)) { |
768 | if (s->type == IVTV_ENC_STREAM_TYPE_MPG && gop_end) { | 765 | if (s->type == IVTV_ENC_STREAM_TYPE_MPG && gop_end) { |
769 | /* only run these if we're shutting down the last cap */ | 766 | /* only run these if we're shutting down the last cap */ |
770 | unsigned long duration; | 767 | unsigned long duration; |
768 | unsigned long then = jiffies; | ||
771 | 769 | ||
772 | then = jiffies; | ||
773 | add_wait_queue(&itv->eos_waitq, &wait); | 770 | add_wait_queue(&itv->eos_waitq, &wait); |
774 | 771 | ||
775 | set_current_state(TASK_INTERRUPTIBLE); | 772 | set_current_state(TASK_INTERRUPTIBLE); |
@@ -797,10 +794,9 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end) | |||
797 | } | 794 | } |
798 | set_current_state(TASK_RUNNING); | 795 | set_current_state(TASK_RUNNING); |
799 | remove_wait_queue(&itv->eos_waitq, &wait); | 796 | remove_wait_queue(&itv->eos_waitq, &wait); |
797 | set_bit(IVTV_F_S_STREAMOFF, &s->s_flags); | ||
800 | } | 798 | } |
801 | 799 | ||
802 | then = jiffies; | ||
803 | |||
804 | /* Handle any pending interrupts */ | 800 | /* Handle any pending interrupts */ |
805 | ivtv_msleep_timeout(100, 1); | 801 | ivtv_msleep_timeout(100, 1); |
806 | } | 802 | } |