tsdemux: Fix scaling macros

While the calculation done in these macros will work with 64bit
integers, they will fail if working with 32bit integers.

Force the scaling up to solve that.

This amazingly didn't introduce major issues up to now, but resulted
in bogus values in debug logs.
This commit is contained in:
Edward Hervey 2014-04-18 16:20:31 +02:00
parent da74a23c1d
commit f96604099d

View file

@ -90,12 +90,12 @@
/* PCR_TO_GST calculation requires at least 10 extra bits.
* Since maximum PCR value is coded with 42 bits, we are
* safe to use direct calculation (10+42 < 63)*/
#define PCRTIME_TO_GSTTIME(t) ((t) * 1000 / 27)
#define PCRTIME_TO_GSTTIME(t) (((t) * (guint64)1000) / 27)
/* MPEG_TO_GST calculation requires at least 17 extra bits (100000)
* Since maximum PTS/DTS value is coded with 33bits, we are
* safe to use direct calculation (17+33 < 63) */
#define MPEGTIME_TO_GSTTIME(t) ((t) * 100000 / 9)
#define MPEGTIME_TO_GSTTIME(t) ((t) * (guint64)100000 / 9)
#define GSTTIME_TO_MPEGTIME(time) (gst_util_uint64_scale ((time), \
CLOCK_BASE, GST_MSECOND/10))