More timestamp calculation fixes similar to the previous ones.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 Aug 2007 07:14:08 +0000 (07:14 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 Aug 2007 07:14:08 +0000 (07:14 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22584 f5534014-38df-0310-8fa8-9805f1628bb7

asn1/mpeg/packet-mpeg-pes-template.c
epan/dissectors/packet-mpeg-pes.c

index 4e9897594bea9d6124cb7d96c17b2ecc15fa5ebd..58b138732b867683140e6414cd56d0e3f4c0ea69 100644 (file)
@@ -135,9 +135,9 @@ static guint64 decode_time_stamp(tvbuff_t *tvb, unsigned offset, nstime_t *nst)
                (bytes >> 33 & 0x0007) << 30 |
                (bytes >> 17 & 0x7fff) << 15 |
                (bytes >>  1 & 0x7fff) << 0;
-       unsigned rem = ts % TSHZ;
-       nst->secs = ts / TSHZ;
-       nst->nsecs = 1000000000LL * rem / TSHZ;
+       unsigned rem = (unsigned)(ts % TSHZ);
+       nst->secs = (time_t)(ts / TSHZ);
+       nst->nsecs = (int)(G_GINT64_CONSTANT(1000000000) * rem / TSHZ);
        return ts;
 }
 
@@ -154,7 +154,7 @@ static guint64 decode_clock_reference(tvbuff_t *tvb, unsigned offset,
        unsigned ext = (unsigned)((bytes >> 1) & 0x1ff);
        guint64 cr = 300 * ts + ext;
        unsigned rem = (unsigned)(cr % SCRHZ);
-       nst->secs = cr / SCRHZ;
+       nst->secs = (time_t)(cr / SCRHZ);
        nst->nsecs = (int)(G_GINT64_CONSTANT(1000000000) * rem / SCRHZ);
        return cr;
 }
index 33e2f99fefc4d362ae2ede913318b872e5b8c58e..95c45bd74e7502f5b1503739cd04fca7c1eb510a 100644 (file)
@@ -576,9 +576,9 @@ static guint64 decode_time_stamp(tvbuff_t *tvb, unsigned offset, nstime_t *nst)
                (bytes >> 33 & 0x0007) << 30 |
                (bytes >> 17 & 0x7fff) << 15 |
                (bytes >>  1 & 0x7fff) << 0;
-       unsigned rem = ts % TSHZ;
-       nst->secs = ts / TSHZ;
-       nst->nsecs = 1000000000LL * rem / TSHZ;
+       unsigned rem = (unsigned)(ts % TSHZ);
+       nst->secs = (time_t)(ts / TSHZ);
+       nst->nsecs = (int)(G_GINT64_CONSTANT(1000000000) * rem / TSHZ);
        return ts;
 }
 
@@ -595,7 +595,7 @@ static guint64 decode_clock_reference(tvbuff_t *tvb, unsigned offset,
        unsigned ext = (unsigned)((bytes >> 1) & 0x1ff);
        guint64 cr = 300 * ts + ext;
        unsigned rem = (unsigned)(cr % SCRHZ);
-       nst->secs = cr / SCRHZ;
+       nst->secs = (time_t)(cr / SCRHZ);
        nst->nsecs = (int)(G_GINT64_CONSTANT(1000000000) * rem / SCRHZ);
        return cr;
 }