mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 21:21:12 +00:00
segment: make conversion more precise
Make sure the conversion from and the conversion to give the same results.
This commit is contained in:
parent
f44204c8fa
commit
afeec70eff
1 changed files with 3 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue