From afeec70effc69dcbcb63b87207428b2715aaa8a1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 9 Jun 2009 10:23:23 +0200 Subject: segment: make conversion more precise Make sure the conversion from and the conversion to give the same results. --- gst/gstsegment.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gst/gstsegment.c') diff --git a/gst/gstsegment.c b/gst/gstsegment.c index 5ecb2e8e4..e4fd3866c 100644 --- a/gst/gstsegment.c +++ b/gst/gstsegment.c @@ -20,6 +20,8 @@ */ +#include + #include "gst_private.h" #include "gstutils.h" @@ -812,7 +814,7 @@ gst_segment_to_position (GstSegment * segment, GstFormat format, /* move into the segment at the right rate */ if (G_UNLIKELY (segment->abs_rate != 1.0)) - result *= segment->abs_rate; + result = ceil (result * segment->abs_rate); if (G_LIKELY (segment->rate > 0.0)) { /* bring to corrected position in segment */ -- cgit v1.2.3