inputselector: Only wait until the active pad's running time is reached if the active...
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 29 Mar 2012 11:39:40 +0000 (13:39 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 29 Mar 2012 12:47:57 +0000 (14:47 +0200)
Otherwise we might block forever because upstream (e.g. multiqueue) is waiting
for the previously active stream to return forever (which is waiting here
in inputselector) before pushing something on the newly selected stream.

plugins/elements/gstinputselector.c

index 4da4735..89cf724 100644 (file)
@@ -683,9 +683,10 @@ gst_input_selector_wait_running_time (GstInputSelector * sel,
    *   d) the active pad has no running time or the active
    *      pad's running time is before this running time
    *   e) the active pad has a non-time segment
+   *   f) the active pad changed and has not pushed anything
    */
-  while (pad != active_selpad && !sel->flushing && !pad->flushing &&
-      (sel->blocked || active_running_time == -1
+  while (pad != active_selpad && !sel->flushing && !pad->flushing
+      && active_selpad->pushed && (sel->blocked || active_running_time == -1
           || running_time >= active_running_time)) {
     if (!sel->blocked)
       GST_DEBUG_OBJECT (pad,