V4L/DVB (6086): ivtv: fix output mode processing: UDMA_YUV wasn't cleared
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 20 Aug 2007 19:01:58 +0000 (16:01 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 01:06:38 +0000 (22:06 -0300)
- Always clear when stopping the decoder
- Clear if the filehandle that is being close was used for UDMA_YUV output.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/ivtv/ivtv-driver.h
drivers/media/video/ivtv/ivtv-fileops.c
drivers/media/video/ivtv/ivtv-ioctl.c

index 03d31860851b01c1a2775f3bd8b8396770f4a17b..3ed4703956d3657f90247ec7e757a052e44b6f49 100644 (file)
@@ -517,6 +517,7 @@ struct ivtv_stream {
 struct ivtv_open_id {
        u32 open_id;
        int type;
+       int yuv_frames;
        enum v4l2_priority prio;
        struct ivtv *itv;
 };
index 1f3c8d0310f50e7f0a8f2b95534ac9e0d58125e5..62ee41c5220bc9afad5b7547e2dfc771daeadf56 100644 (file)
@@ -757,6 +757,7 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts)
                IVTV_DEBUG_INFO("close stopping decode\n");
 
                ivtv_stop_v4l2_decode_stream(s, flags, pts);
+               itv->output_mode = OUT_NONE;
        }
        clear_bit(IVTV_F_S_APPL_IO, &s->s_flags);
        clear_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
@@ -764,11 +765,7 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts)
                /* Restore registers we've changed & clean up any mess we've made */
                ivtv_yuv_close(itv);
        }
-       if (s->type == IVTV_DEC_STREAM_TYPE_YUV && itv->output_mode == OUT_YUV)
-               itv->output_mode = OUT_NONE;
-       else if (s->type == IVTV_DEC_STREAM_TYPE_YUV && itv->output_mode == OUT_UDMA_YUV)
-               itv->output_mode = OUT_NONE;
-       else if (s->type == IVTV_DEC_STREAM_TYPE_MPG && itv->output_mode == OUT_MPG)
+       if (itv->output_mode == OUT_UDMA_YUV && id->yuv_frames)
                itv->output_mode = OUT_NONE;
 
        itv->speed = 0;
index ed5707660e0e360638b5236f3d2b406413aa4352..2bb1e324785bb9d5c09a6b6058cb56420becdca4 100644 (file)
@@ -1346,6 +1346,8 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
                        ivtv_release_stream(s);
                        return -EBUSY;
                }
+               /* Mark that this file handle started the UDMA_YUV mode */
+               id->yuv_frames = 1;
                if (args->y_source == NULL)
                        return 0;
                return ivtv_yuv_prep_frame(itv, args);