mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
clock: Fix _STIME_FORMAT macros
This macro didn't work well as it relied on the sign on the last divided number (number of days). This value is most of the time zero, and zero is considered positive in printf. Instead, deal with the sign manually, and resuse the original macros for the rest. This actually simplify the macro a lot.
This commit is contained in:
parent
7be8acbfb0
commit
5bdd92be75
1 changed files with 2 additions and 9 deletions
|
@ -253,7 +253,7 @@ G_STMT_START { \
|
|||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
#define GST_STIME_FORMAT "d:%02u:%02u.%09u"
|
||||
#define GST_STIME_FORMAT "c%" GST_TIME_FORMAT
|
||||
/**
|
||||
* GST_STIME_ARGS:
|
||||
* @t: a #GstClockTimeDiff or #gint64
|
||||
|
@ -264,14 +264,7 @@ G_STMT_START { \
|
|||
* Since: 1.6
|
||||
*/
|
||||
#define GST_STIME_ARGS(t) \
|
||||
GST_CLOCK_STIME_IS_VALID (t) ? \
|
||||
(gint) ((GstClockTimeDiff)(t) / (GST_SECOND * 60 * 60)) : -99, \
|
||||
GST_CLOCK_STIME_IS_VALID (t) ? \
|
||||
(guint) ((((GstClockTime)ABS(t)) / (GST_SECOND * 60)) % 60) : 99, \
|
||||
GST_CLOCK_STIME_IS_VALID (t) ? \
|
||||
(guint) ((((GstClockTime)ABS(t)) / GST_SECOND) % 60) : 99, \
|
||||
GST_CLOCK_STIME_IS_VALID (t) ? \
|
||||
(guint) (((GstClockTime)ABS(t)) % GST_SECOND) : 999999999
|
||||
((t) >= 0) ? ' ' : '-', GST_TIME_ARGS (ABS (t))
|
||||
|
||||
typedef struct _GstClockEntry GstClockEntry;
|
||||
typedef struct _GstClock GstClock;
|
||||
|
|
Loading…
Reference in a new issue