[media] stk1160: fix sequence handling
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 8 Jun 2015 09:53:59 +0000 (06:53 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 6 Jul 2015 11:25:46 +0000 (08:25 -0300)
Fix the sequence counter: we're counting frames, not fields.

Also remove the unused 'field' field. That would only be needed if this driver
would support V4L2_FIELD_ALTERNATE.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/stk1160/stk1160-v4l.c
drivers/media/usb/stk1160/stk1160-video.c
drivers/media/usb/stk1160/stk1160.h

index 4d313ed4c32e15ecd7b1d45b9f2f6909995029da..7291cca587042bcce232d574cc28a15fbee82d82 100644 (file)
@@ -194,6 +194,8 @@ static int stk1160_start_streaming(struct stk1160 *dev)
        /* Start saa711x */
        v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 1);
 
+       dev->sequence = 0;
+
        /* Start stk1160 */
        stk1160_write_reg(dev, STK1160_DCTRL, 0xb3);
        stk1160_write_reg(dev, STK1160_DCTRL+3, 0x00);
index 39f1aae209bccf9d011ab8401bdacde18fd122f4..940c3eaea507eb2f8070a3419ebb729b5d17b853 100644 (file)
@@ -96,9 +96,7 @@ void stk1160_buffer_done(struct stk1160 *dev)
 {
        struct stk1160_buffer *buf = dev->isoc_ctl.buf;
 
-       dev->field_count++;
-
-       buf->vb.v4l2_buf.sequence = dev->field_count >> 1;
+       buf->vb.v4l2_buf.sequence = dev->sequence++;
        buf->vb.v4l2_buf.field = V4L2_FIELD_INTERLACED;
        buf->vb.v4l2_buf.bytesused = buf->bytesused;
        v4l2_get_timestamp(&buf->vb.v4l2_buf.timestamp);
index abdea484c9987ad25dcaff6e4582881522e5f68d..3922a6cabde29d52c2d87f0f432acafbb94fde2e 100644 (file)
@@ -151,8 +151,7 @@ struct stk1160 {
        v4l2_std_id norm;         /* current norm */
        struct stk1160_fmt *fmt;  /* selected format */
 
-       unsigned int field_count; /* not sure ??? */
-       enum v4l2_field field;    /* also not sure :/ */
+       unsigned int sequence;
 
        /* i2c i/o */
        struct i2c_adapter i2c_adap;