mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 16:48:11 +00:00
basesink: fix position reporting
Only update the current stream time after we checked if we got a new step event. This improves the position reporting by the sink. See #595958
This commit is contained in:
parent
0ed24bc50e
commit
9da89ef4e1
1 changed files with 8 additions and 7 deletions
|
@ -1854,6 +1854,7 @@ do_times:
|
||||||
&rstart, &rstop))) {
|
&rstart, &rstop))) {
|
||||||
/* step is still busy, we discard data when we are flushing */
|
/* step is still busy, we discard data when we are flushing */
|
||||||
*stepped = step->flush;
|
*stepped = step->flush;
|
||||||
|
GST_DEBUG_OBJECT (basesink, "stepping busy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* this can produce wrong values if we accumulated non-TIME segments. If this happens,
|
/* this can produce wrong values if we accumulated non-TIME segments. If this happens,
|
||||||
|
@ -2254,13 +2255,6 @@ again:
|
||||||
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
||||||
goto preroll_failed;
|
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 = (GST_CLOCK_TIME_IS_VALID (sstop) ? sstop : sstart);
|
|
||||||
GST_OBJECT_UNLOCK (basesink);
|
|
||||||
|
|
||||||
/* update the segment with a pending step if the current one is invalid and we
|
/* 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 */
|
* have a new pending one. We only accept new step updates after a preroll */
|
||||||
if (G_UNLIKELY (pending->valid && !current->valid)) {
|
if (G_UNLIKELY (pending->valid && !current->valid)) {
|
||||||
|
@ -2268,6 +2262,13 @@ again:
|
||||||
goto do_step;
|
goto do_step;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 = (GST_CLOCK_TIME_IS_VALID (sstop) ? sstop : sstart);
|
||||||
|
GST_OBJECT_UNLOCK (basesink);
|
||||||
|
|
||||||
if (!do_sync)
|
if (!do_sync)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue