summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-06 13:13:38 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-06 13:14:14 +0100
commitf3653854585864a09d35e037853407332ea6901f (patch)
treebe022e99bd6e251b323e64427738681b74928337
parente75da74a93cab676aac845867362eca139f2c1b8 (diff)
inputselector: Make sure that running_time->timestamp calculation never becomes negative
-rw-r--r--gst/playback/gstinputselector.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/playback/gstinputselector.c b/gst/playback/gstinputselector.c
index 3dcc48eef..54ab287ee 100644
--- a/gst/playback/gstinputselector.c
+++ b/gst/playback/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