]> 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 e12c6022373e38afaaf0ad3b559f3184b67456f9..6917c497fb7e7f441060ffdef116c587fb0af156 100644 (file)
@@ -577,6 +577,9 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
                clear_bit(IVTV_F_I_EOS, &itv->i_flags);
 
                /* Initialize Digitizer for Capture */
+               /* Avoid tinny audio problem - ensure audio clocks are going */
+               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(300, 1);
                ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
@@ -826,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;