mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
segment: Fix seeking when position is slightly outside the segment
Very often, when the end of a segment is detected by demuxer, the position is slightly outside the segment boundaries. Currently, if that is the case the base will be set to NONE instead of normal accumulation. This would break non-flushing seeks in oggdemux and most likely other demuxers. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=696899
This commit is contained in:
parent
1234ae5e48
commit
ab44e14c52
1 changed files with 3 additions and 0 deletions
|
@ -311,6 +311,9 @@ gst_segment_do_seek (GstSegment * segment, gdouble rate,
|
|||
/* flush resets the running_time */
|
||||
base = 0;
|
||||
} else {
|
||||
/* make sure the position is inside the segment start/stop */
|
||||
position = CLAMP (position, segment->start, segment->stop);
|
||||
|
||||
/* remember the elapsed time */
|
||||
base = gst_segment_to_running_time (segment, format, position);
|
||||
GST_DEBUG ("updated segment.base: %" G_GUINT64_FORMAT, base);
|
||||
|
|
Loading…
Reference in a new issue