From 799020804f10daa3ad25c9c97996d17c1f5f1708 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Mon, 2 Nov 2015 16:09:52 +0000 Subject: [PATCH] oggdemux: Use GstClockTimeDiff and print signed integer in debug logs Use GstClockTimeDiff and Clock macros to print signed integer time differences in the debug logs. https://bugzilla.gnome.org/show_bug.cgi?id=757480 --- ext/ogg/gstoggdemux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index ee750b25b2..0264469820 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1537,8 +1537,8 @@ gst_ogg_demux_seek_back_after_push_duration_check_unlock (GstOggDemux * ogg) static float gst_ogg_demux_estimate_seek_quality (GstOggDemux * ogg) { - gint64 diff; /* how far from the goal we ended up */ - gint64 dist; /* how far we moved this iteration */ + GstClockTimeDiff diff; /* how far from the goal we ended up */ + GstClockTimeDiff dist; /* how far we moved this iteration */ float seek_quality; if (ogg->push_prev_seek_time == GST_CLOCK_TIME_NONE) { @@ -1550,18 +1550,18 @@ gst_ogg_demux_estimate_seek_quality (GstOggDemux * ogg) /* We take a guess at how good the last seek was at guessing the byte target by comparing the amplitude of the last seek to the error */ - diff = ogg->push_seek_time_target - ogg->push_last_seek_time; + diff = GST_CLOCK_DIFF (ogg->push_seek_time_target, ogg->push_last_seek_time); if (diff < 0) diff = -diff; - dist = ogg->push_last_seek_time - ogg->push_prev_seek_time; + dist = GST_CLOCK_DIFF (ogg->push_last_seek_time, ogg->push_prev_seek_time); if (dist < 0) dist = -dist; seek_quality = (dist == 0) ? 0.0f : 1.0f / (1.0f + diff / (float) dist); GST_DEBUG_OBJECT (ogg, - "We moved %" GST_TIME_FORMAT ", we're off by %" GST_TIME_FORMAT - ", seek quality %f", GST_TIME_ARGS (dist), GST_TIME_ARGS (diff), + "We moved %" GST_STIME_FORMAT ", we're off by %" GST_STIME_FORMAT + ", seek quality %f", GST_STIME_ARGS (dist), GST_STIME_ARGS (diff), seek_quality); return seek_quality; }