From c437e3b4e26da36b7977ef6ba2b310f007f37efa Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 28 Nov 2007 12:52:42 +0000 Subject: [PATCH] gst/: Fix wrong order of args in GST_CLOCK_DIFF() usage. Original commit message from CVS: * gst/gstdebugutils.c: * gst/gstinfo.c: Fix wrong order of args in GST_CLOCK_DIFF() usage. * tools/gst-launch.c: Use new API to get elapsed time. --- ChangeLog | 9 +++++++++ gst/gstdebugutils.c | 2 +- gst/gstinfo.c | 2 +- tools/gst-launch.c | 8 ++++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76b4502ef9..f7ff860bd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-11-28 Stefan Kost + + * gst/gstdebugutils.c: + * gst/gstinfo.c: + Fix wrong order of args in GST_CLOCK_DIFF() usage. + + * tools/gst-launch.c: + Use new API to get elapsed time. + 2007-11-28 Stefan Kost * docs/gst/gstreamer-sections.txt: diff --git a/gst/gstdebugutils.c b/gst/gstdebugutils.c index 02b17e1377..0927eeebfc 100644 --- a/gst/gstdebugutils.c +++ b/gst/gstdebugutils.c @@ -508,7 +508,7 @@ _gst_debug_bin_to_dot_file_with_ts (GstBin * bin, GstDebugGraphDetails details, /* add timestamp */ GST_GET_TIMESTAMP (now); - elapsed = GST_CLOCK_DIFF (now, _priv_gst_info_start_time); + elapsed = GST_CLOCK_DIFF (_priv_gst_info_start_time, now); ts_file_name = g_strdup_printf ("%" GST_TIME_FORMAT "-%s", GST_TIME_ARGS (elapsed), file_name); diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 45ac95e11a..0ca33469fd 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -666,7 +666,7 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level, } GST_GET_TIMESTAMP (now); - elapsed = GST_CLOCK_DIFF (now, _priv_gst_info_start_time); + elapsed = GST_CLOCK_DIFF (_priv_gst_info_start_time, now); /* g_printerr ("%s (%p - %" GST_TIME_FORMAT ") %s%20s%s(%s%5d%s) %s%s(%d):%s:%s%s %s\n", diff --git a/tools/gst-launch.c b/tools/gst-launch.c index cedc6244ad..01c92ecfba 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -747,7 +747,7 @@ main (int argc, char *argv[]) if (caught_error) { fprintf (stderr, _("ERROR: pipeline doesn't want to preroll.\n")); } else { - GTimeVal tfthen, tfnow; + GstClockTime tfthen, tfnow; GstClockTimeDiff diff; fprintf (stderr, _("Setting pipeline to PLAYING ...\n")); @@ -773,11 +773,11 @@ main (int argc, char *argv[]) goto end; } - g_get_current_time (&tfthen); + GST_GET_TIMESTAMP (tfthen); caught_error = event_loop (pipeline, TRUE, GST_STATE_PLAYING); - g_get_current_time (&tfnow); + GST_GET_TIMESTAMP (tfnow); - diff = GST_TIMEVAL_TO_TIME (tfnow) - GST_TIMEVAL_TO_TIME (tfthen); + diff = GST_CLOCK_DIFF (tfthen, tfnow); g_print (_("Execution ended after %" G_GUINT64_FORMAT " ns.\n"), diff); }