summaryrefslogtreecommitdiff
path: root/gst/gstsegment.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-06-09 10:23:23 +0200
committerWim Taymans <wim@metal.(none)>2009-06-09 10:23:23 +0200
commitafeec70effc69dcbcb63b87207428b2715aaa8a1 (patch)
tree7e245e1ecabd90f5e3e7789524f6b7fcd686758d /gst/gstsegment.c
parentf44204c8fa671dc584ea838df7b2f7259a87a23a (diff)
segment: make conversion more precise
Make sure the conversion from and the conversion to give the same results.
Diffstat (limited to 'gst/gstsegment.c')
-rw-r--r--gst/gstsegment.c4
1 files changed, 3 insertions, 1 deletions
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 <math.h>
+
#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 */