From: Ian Armstrong Date: Sun, 7 Mar 2010 00:37:04 +0000 (-0300) Subject: V4L/DVB: ivtv: Really stop capture on device close X-Git-Tag: v2.6.35-rc1~480^2~390 X-Git-Url: http://bbs.cooldavid.org/git/?a=commitdiff_plain;h=9a766d55b72a439b2e16ecf2ac3eb831ab25e0d3;p=net-next-2.6.git V4L/DVB: ivtv: Really stop capture on device close When a capture is started, the firmware also appears to start a secondary stream. Unless this secondary stream is also stopped, the encoder will remain active and not reinitialise for the next capture. Unfortunately, setting up the video source can glitch the encoder and result in undesirable effects that this initialisation will clear. Signed-off-by: Ian Armstrong Signed-off-by: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index a994b0adb44..6917c497fb7 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c @@ -829,6 +829,10 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end) ivtv_set_irq_mask(itv, IVTV_IRQ_ENC_VIM_RST); } + /* Raw-passthrough is implied on start. Make sure it's stopped so + the encoder will re-initialize when next started */ + ivtv_vapi(itv, CX2341X_ENC_STOP_CAPTURE, 3, 1, 2, 7); + wake_up(&s->waitq); return 0;