aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2007-08-22 07:14:08 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2007-08-22 07:14:08 +0000
commit949a060f03bf8b007d6044c86384ed8a135e3c4d (patch)
treecb8f9e57e2478d1386d31ffbf04b4f4140f6b203
parentd5085e4c5dbbbd632376eac7c7e71f1908341113 (diff)
More timestamp calculation fixes similar to the previous ones.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22584 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--asn1/mpeg/packet-mpeg-pes-template.c8
-rw-r--r--epan/dissectors/packet-mpeg-pes.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/asn1/mpeg/packet-mpeg-pes-template.c b/asn1/mpeg/packet-mpeg-pes-template.c
index 4e9897594b..58b138732b 100644
--- a/asn1/mpeg/packet-mpeg-pes-template.c
+++ b/asn1/mpeg/packet-mpeg-pes-template.c
@@ -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;
}
diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c
index 33e2f99fef..95c45bd74e 100644
--- a/epan/dissectors/packet-mpeg-pes.c
+++ b/epan/dissectors/packet-mpeg-pes.c
@@ -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;
}