basesink: recompute correct running time for buffer ending flushing step
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Mon, 18 Oct 2010 08:46:59 +0000 (10:46 +0200)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Wed, 20 Oct 2010 16:46:39 +0000 (18:46 +0200)
Prevents delaying/hanging when resuming PLAYING.

Fixes #632433.

libs/gst/base/gstbasesink.c

index 768f7c9..951940e 100644 (file)
@@ -1889,6 +1889,7 @@ gst_base_sink_get_sync_times (GstBaseSink * basesink, GstMiniObject * obj,
 
   eos = FALSE;
 
+again:
   /* else do buffer sync code */
   buffer = GST_BUFFER_CAST (obj);
 
@@ -1978,6 +1979,12 @@ eos_done:
     GST_DEBUG_OBJECT (basesink, "flushing step ended");
     stop_stepping (basesink, segment, step, rstart, rstop, eos);
     *step_end = FALSE;
+    /* re-determine running start times for adjusted segment
+     * (which has a flushed amount of running/accumulated time removed) */
+    if (!GST_IS_EVENT (obj)) {
+      GST_DEBUG_OBJECT (basesink, "refresh sync times");
+      goto again;
+    }
   }
 
   /* save times */