mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +00:00
inputselector: Make sure that running_time->timestamp calculation never becomes negative
Merged from gst-plugins-base, f365385458
.
This commit is contained in:
parent
a1f6660655
commit
9b2753c6e9
1 changed files with 4 additions and 1 deletions
|
@ -907,6 +907,9 @@ gst_input_selector_dispose (GObject * object)
|
||||||
static gint64
|
static gint64
|
||||||
gst_segment_get_timestamp (GstSegment * segment, gint64 running_time)
|
gst_segment_get_timestamp (GstSegment * segment, gint64 running_time)
|
||||||
{
|
{
|
||||||
|
if (running_time <= segment->accum)
|
||||||
|
return segment->start;
|
||||||
|
else
|
||||||
return (running_time - segment->accum) * segment->abs_rate + segment->start;
|
return (running_time - segment->accum) * segment->abs_rate + segment->start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue