]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/media/video/ivtv/ivtv-streams.c
V4L/DVB: ivtv: Really stop capture on device close
[karo-tx-linux.git] / drivers / media / video / ivtv / ivtv-streams.c
index 1f9387f6ca240d39c03ea805369b8c6e74c7e753..6917c497fb7e7f441060ffdef116c587fb0af156 100644 (file)
@@ -581,10 +581,9 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
                v4l2_subdev_call(itv->sd_audio, audio, s_stream, 1);
                /* Avoid unpredictable PCI bus hang - disable video clocks */
                v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
-               ivtv_msleep_timeout(150, 1);
+               ivtv_msleep_timeout(300, 1);
                ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
                v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
-               ivtv_msleep_timeout(150, 1);
        }
 
        /* begin_capture */
@@ -830,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;