From 71a5ebe638ed611d488c9ffedbf03b7cf9c14dac Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 2 Jun 2009 15:37:22 +0200 Subject: [PATCH] basesink: fix regression in unit tests Store the timestamp of the buffer after prerolling. While we are prerolled we want to report the position of the segment start value. --- libs/gst/base/gstbasesink.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 53c4a37..431797e 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -2169,13 +2169,6 @@ do_step: priv->eos_rtime = (do_sync ? priv->current_rstop : -1); again: - /* Before preroll we store the position of the last buffer so that we can use - * it to report the position. We need to take the lock here. */ - GST_OBJECT_LOCK (basesink); - priv->current_sstart = sstart; - priv->current_sstop = (sstop != -1 ? sstop : sstart); - GST_OBJECT_UNLOCK (basesink); - /* first do preroll, this makes sure we commit our state * to PAUSED and can continue to PLAYING. We cannot perform * any clock sync in PAUSED because there is no clock. */ @@ -2183,6 +2176,13 @@ again: if (G_UNLIKELY (ret != GST_FLOW_OK)) goto preroll_failed; + /* After rendering we store the position of the last buffer so that we can use + * it to report the position. We need to take the lock here. */ + GST_OBJECT_LOCK (basesink); + priv->current_sstart = sstart; + priv->current_sstop = (sstop != -1 ? sstop : sstart); + GST_OBJECT_UNLOCK (basesink); + /* update the segment with a pending step if the current one is invalid and we * have a new pending one. We only accept new step updates after a preroll */ if (G_UNLIKELY (pending->valid && !current->valid)) { -- 2.7.4