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

This commit is contained in:
Sebastian Dröge 2009-11-06 13:13:38 +01:00
parent e75da74a93
commit f365385458

View file

@ -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;
} }