From 9a627f1106814e6b1e50e89cb2a7119a0175869d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 9 Nov 2009 11:48:39 +0100 Subject: [PATCH] inputselector: Make sure that running_time->timestamp calculation never becomes negative Merged from gst-plugins-base, f3653854585864a09d35e037853407332ea6901f. --- gst/selector/gstinputselector.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/selector/gstinputselector.c b/gst/selector/gstinputselector.c index 0929cdf999..9cd3a7985e 100644 --- a/gst/selector/gstinputselector.c +++ b/gst/selector/gstinputselector.c @@ -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