mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-11 02:24:13 +00:00
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:
parent
da74a23c1d
commit
f96604099d
1 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue