mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
basesink: Don't clip the reported position in PAUSED to after the last buffer end timestamp
Otherwise we jump forward when pausing, and go backwards a bit again when resuming playback.
This commit is contained in:
parent
75784c3441
commit
f7b71d3007
1 changed files with 6 additions and 13 deletions
|
@ -4431,9 +4431,8 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
||||||
start = basesink->priv->current_sstart;
|
start = basesink->priv->current_sstart;
|
||||||
stop = basesink->priv->current_sstop;
|
stop = basesink->priv->current_sstop;
|
||||||
|
|
||||||
if (in_paused || last_seen) {
|
if (last_seen) {
|
||||||
/* in paused or when we don't use the clock, we use the last position
|
/* when we don't use the clock, we use the last position as a lower bound */
|
||||||
* as a lower bound */
|
|
||||||
if (stop == -1 || segment->rate > 0.0)
|
if (stop == -1 || segment->rate > 0.0)
|
||||||
last = start;
|
last = start;
|
||||||
else
|
else
|
||||||
|
@ -4442,7 +4441,7 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
||||||
GST_DEBUG_OBJECT (basesink, "in PAUSED using last %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (basesink, "in PAUSED using last %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (last));
|
GST_TIME_ARGS (last));
|
||||||
} else {
|
} else {
|
||||||
/* in playing, use last stop time as upper bound */
|
/* in playing and paused, use last stop time as upper bound */
|
||||||
if (start == -1 || segment->rate > 0.0)
|
if (start == -1 || segment->rate > 0.0)
|
||||||
last = stop;
|
last = stop;
|
||||||
else
|
else
|
||||||
|
@ -4519,15 +4518,9 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
||||||
|
|
||||||
*cur = time + gst_guint64_to_gdouble (now - base_time) * rate;
|
*cur = time + gst_guint64_to_gdouble (now - base_time) * rate;
|
||||||
|
|
||||||
if (in_paused) {
|
/* never report more than last seen position */
|
||||||
/* never report less than segment values in paused */
|
if (last != -1)
|
||||||
if (last != -1)
|
*cur = MIN (last, *cur);
|
||||||
*cur = MAX (last, *cur);
|
|
||||||
} else {
|
|
||||||
/* never report more than last seen position in playing */
|
|
||||||
if (last != -1)
|
|
||||||
*cur = MIN (last, *cur);
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (basesink,
|
GST_DEBUG_OBJECT (basesink,
|
||||||
"now %" GST_TIME_FORMAT " - base_time %" GST_TIME_FORMAT " - base %"
|
"now %" GST_TIME_FORMAT " - base_time %" GST_TIME_FORMAT " - base %"
|
||||||
|
|
Loading…
Reference in a new issue