V4L/DVB (5403): Set vsync_field correctly in ivtv.
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 10 Mar 2007 09:30:19 +0000 (06:30 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 27 Apr 2007 18:44:23 +0000 (15:44 -0300)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/ivtv/ivtv-ioctl.c

index 448e8dd5b42f493b8986e1d05e8fab5f4c1e5080..0e8b639de179b87675e6def137d20fbff766c52f 100644 (file)
@@ -1314,9 +1314,13 @@ static int ivtv_ivtv_ioctls(struct file *filp, unsigned int cmd, void *arg)
                                ev->type = VIDEO_EVENT_DECODER_STOPPED;
                        else if (test_and_clear_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags)) {
                                ev->type = VIDEO_EVENT_VSYNC;
-                               ev->timestamp = test_bit(IVTV_F_I_EV_VSYNC_FIELD, &itv->i_flags) ?
-                                       1 : 0;
-                               clear_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
+                               ev->u.vsync_field = test_bit(IVTV_F_I_EV_VSYNC_FIELD, &itv->i_flags) ?
+                                       VIDEO_VSYNC_FIELD_ODD : VIDEO_VSYNC_FIELD_EVEN;
+                               if (itv->output_mode == OUT_UDMA_YUV &&
+                                       (itv->yuv_info.lace_mode & IVTV_YUV_MODE_MASK) ==
+                                                               IVTV_YUV_MODE_PROGRESSIVE) {
+                                       ev->u.vsync_field = VIDEO_VSYNC_FIELD_PROGRESSIVE;
+                               }
                        }
                        if (ev->type)
                                return 0;