mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 10:55:34 +00:00
segment: resurrect sanitizing start and stop for seeking
This commit is contained in:
parent
8d818eb981
commit
7e2277000c
1 changed files with 3 additions and 3 deletions
|
@ -268,7 +268,7 @@ gst_segment_do_seek (GstSegment * segment, gdouble rate,
|
||||||
if (segment->duration != -1)
|
if (segment->duration != -1)
|
||||||
start = MIN (start, segment->duration);
|
start = MIN (start, segment->duration);
|
||||||
else
|
else
|
||||||
start = MAX (start, 0);
|
start = MAX ((gint64) start, 0);
|
||||||
|
|
||||||
/* stop can be -1 if we have not configured a stop. */
|
/* stop can be -1 if we have not configured a stop. */
|
||||||
switch (stop_type) {
|
switch (stop_type) {
|
||||||
|
@ -292,9 +292,9 @@ gst_segment_do_seek (GstSegment * segment, gdouble rate,
|
||||||
/* if we have a valid stop time, make sure it is clipped */
|
/* if we have a valid stop time, make sure it is clipped */
|
||||||
if (stop != -1) {
|
if (stop != -1) {
|
||||||
if (segment->duration != -1)
|
if (segment->duration != -1)
|
||||||
stop = CLAMP (stop, 0, segment->duration);
|
stop = CLAMP ((gint64) stop, 0, (gint64) segment->duration);
|
||||||
else
|
else
|
||||||
stop = MAX (stop, 0);
|
stop = MAX ((gint64) stop, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we can't have stop before start */
|
/* we can't have stop before start */
|
||||||
|
|
Loading…
Reference in a new issue