diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-13 20:36:11 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-13 20:36:11 -0200 |
commit | e76427bffbcf128ab311a816734ecf6140546736 (patch) | |
tree | b45ebaa27d46f932e42e2302941dbb64a0870922 /linux/drivers/media/video/vivi.c | |
parent | eeeaa6f58e6e49b58349bab51c91de411404f358 (diff) | |
download | mediapointer-dvb-s2-e76427bffbcf128ab311a816734ecf6140546736.tar.gz mediapointer-dvb-s2-e76427bffbcf128ab311a816734ecf6140546736.tar.bz2 |
Fix timestamp presentation on vivi driver
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Due to date overflow, vivi were not working fine anymore.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/vivi.c')
-rw-r--r-- | linux/drivers/media/video/vivi.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c index 0305589d1..4222abbfc 100644 --- a/linux/drivers/media/video/vivi.c +++ b/linux/drivers/media/video/vivi.c @@ -190,7 +190,8 @@ struct vivi_dev { struct vivi_dmaqueue vidq; /* Several counters */ - int h, m, s, us, jiffies; + int h, m, s, ms; + unsigned long jiffies; char timestr[13]; int mv_count; /* Controls bars movement */ @@ -365,10 +366,10 @@ static void vivi_fillbuff(struct vivi_dev *dev, struct vivi_buffer *buf) /* Updates stream time */ - dev->us += jiffies_to_usecs(jiffies-dev->jiffies); + dev->ms += jiffies_to_msecs(jiffies-dev->jiffies); dev->jiffies = jiffies; - if (dev->us >= 1000000) { - dev->us -= 1000000; + if (dev->ms >= 1000) { + dev->ms -= 1000; dev->s++; if (dev->s >= 60) { dev->s -= 60; @@ -382,7 +383,7 @@ static void vivi_fillbuff(struct vivi_dev *dev, struct vivi_buffer *buf) } } sprintf(dev->timestr, "%02d:%02d:%02d:%03d", - dev->h, dev->m, dev->s, (dev->us + 500) / 1000); + dev->h, dev->m, dev->s, dev->ms); dprintk(dev, 2, "vivifill at %s: Buffer 0x%08lx size= %d\n", dev->timestr, (unsigned long)tmpbuf, pos); @@ -1147,11 +1148,11 @@ found: dev->h = 0; dev->m = 0; dev->s = 0; - dev->us = 0; + dev->ms = 0; dev->mv_count = 0; dev->jiffies = jiffies; sprintf(dev->timestr, "%02d:%02d:%02d:%03d", - dev->h, dev->m, dev->s, (dev->us + 500) / 1000); + dev->h, dev->m, dev->s, dev->ms); videobuf_queue_vmalloc_init(&fh->vb_vidq, &vivi_video_qops, NULL, &dev->slock, fh->type, V4L2_FIELD_INTERLACED, |