summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2010-10-12 00:00:50 +0300
committerStefan Kost <ensonic@users.sf.net>2010-10-12 00:00:50 +0300
commit22d318318efffb6b0abf6a4dd99d295201b902cf (patch)
treee22a58cbc45f061be642aafb0cac8b04c949cb01
parent83262140190c049d2e4aed3e88964c991f7d26b5 (diff)
tracelib: sort pads also by their direction
If the timestamp is the same, have the src pad first
-rw-r--r--src/gsttracelib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gsttracelib.c b/src/gsttracelib.c
index 94723b4..2a583bd 100644
--- a/src/gsttracelib.c
+++ b/src/gsttracelib.c
@@ -767,9 +767,17 @@ _accum_element_stats (gpointer value, gpointer user_data)
/* sorting */
static gint
-_sort_pad_stats_by_first_activity (gconstpointer es1, gconstpointer es2)
+_sort_pad_stats_by_first_activity (gconstpointer ps1, gconstpointer ps2)
{
- return (GST_CLOCK_DIFF (((GsttlPadStats *)es2)->first_ts,((GsttlPadStats *)es1)->first_ts));
+ GsttlPadStats *s1 = (GsttlPadStats *)ps1;
+ GsttlPadStats *s2 = (GsttlPadStats *)ps2;
+
+ gint order = GST_CLOCK_DIFF (s2->first_ts, s1->first_ts);
+
+ if (!order) {
+ order = s1->dir - s2->dir;
+ }
+ return (order);
}
static void