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.
This commit is contained in:
Wim Taymans 2009-06-02 15:37:22 +02:00
parent 51f50a5c67
commit 71a5ebe638

View file

@ -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)) {