inputselector: Make sure that running_time->timestamp calculation never becomes negative

Merged from gst-plugins-base, f365385458.
This commit is contained in:
Sebastian Dröge 2009-11-09 11:48:39 +01:00 committed by Tim-Philipp Müller
parent a1f6660655
commit 9b2753c6e9

View file

@ -907,7 +907,10 @@ gst_input_selector_dispose (GObject * object)
static gint64
gst_segment_get_timestamp (GstSegment * segment, gint64 running_time)
{
return (running_time - segment->accum) * segment->abs_rate + segment->start;
if (running_time <= segment->accum)
return segment->start;
else
return (running_time - segment->accum) * segment->abs_rate + segment->start;
}
static void