mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
basesink: clamp reported position based on direction
When using a negative rate (rate being segment.rate * segment.applied_rate), we will end up reporting decreasing positions, therefore adjust the clamping against last reported value accordingly. Fixes positions getting properly reported with applied_rate < 0.0 https://bugzilla.gnome.org/show_bug.cgi?id=738092
This commit is contained in:
parent
154eefecc9
commit
05092eda8e
1 changed files with 6 additions and 2 deletions
|
@ -4581,8 +4581,12 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
|||
*cur = time + gst_guint64_to_gdouble (now - base_time) * rate;
|
||||
|
||||
/* never report more than last seen position */
|
||||
if (last != -1)
|
||||
*cur = MIN (last, *cur);
|
||||
if (last != -1) {
|
||||
if (rate > 0.0)
|
||||
*cur = MIN (last, *cur);
|
||||
else
|
||||
*cur = MAX (last, *cur);
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (basesink,
|
||||
"now %" GST_TIME_FORMAT " - base_time %" GST_TIME_FORMAT " - base %"
|
||||
|
|
Loading…
Reference in a new issue