projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f44204c
)
segment: make conversion more precise
author
Wim Taymans
<wim.taymans@collabora.co.uk>
Tue, 9 Jun 2009 08:23:23 +0000
(10:23 +0200)
committer
Wim Taymans
<wim@metal.(none)>
Tue, 9 Jun 2009 08:23:23 +0000
(10:23 +0200)
Make sure the conversion from and the conversion to give the same results.
gst/gstsegment.c
patch
|
blob
|
history
diff --git
a/gst/gstsegment.c
b/gst/gstsegment.c
index
5ecb2e8
..
e4fd386
100644
(file)
--- 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 */