gst/gstbin.c: Only care about latency min and max when the sink is actually a live...
authorWim Taymans <wim.taymans@gmail.com>
Wed, 25 Jun 2008 11:50:06 +0000 (11:50 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 25 Jun 2008 11:50:06 +0000 (11:50 +0000)
Original commit message from CVS:
* gst/gstbin.c: (bin_query_latency_fold):
Only care about latency min and max when the sink is actually a live
sink.

ChangeLog
gst/gstbin.c

index 5e78243..abf23be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-06-25  Wim Taymans  <wim.taymans@collabora.co.uk>
 
+       * gst/gstbin.c: (bin_query_latency_fold):
+       Only care about latency min and max when the sink is actually a live
+       sink.
+
+2008-06-25  Wim Taymans  <wim.taymans@collabora.co.uk>
+
        * docs/design/part-block.txt:
        Fix typo.
 
index fcbef9a..f959a69 100644 (file)
@@ -3029,14 +3029,16 @@ bin_query_latency_fold (GstElement * item, GValue * ret, QueryFold * fold)
 
     /* for the combined latency we collect the MAX of all min latencies and
      * the MIN of all max latencies */
-    if (min > fold->min)
-      fold->min = min;
-    if (fold->max == -1)
-      fold->max = max;
-    else if (max < fold->max)
-      fold->max = max;
-    if (fold->live == FALSE)
-      fold->live = live;
+    if (live) {
+      if (min > fold->min)
+        fold->min = min;
+      if (fold->max == -1)
+        fold->max = max;
+      else if (max < fold->max)
+        fold->max = max;
+      if (fold->live == FALSE)
+        fold->live = live;
+    }
   } else {
     g_value_set_boolean (ret, FALSE);
     GST_DEBUG_OBJECT (item, "failed query");