audio: Use rounding scaling functions for GST_CLOCK_TIME_TO_FRAMES and _FRAMES_TO_CLOCK_TIME

Fixes bug #607381.
This commit is contained in:
Sebastian Dröge 2010-01-19 09:25:35 +01:00
parent 125f7dfdb0
commit 6dfc0270ec

View file

@ -58,7 +58,7 @@ G_BEGIN_DECLS
* Calculate clocktime from sample @frames and @rate. * Calculate clocktime from sample @frames and @rate.
*/ */
#define GST_FRAMES_TO_CLOCK_TIME(frames, rate) \ #define GST_FRAMES_TO_CLOCK_TIME(frames, rate) \
((GstClockTime) gst_util_uint64_scale (frames, GST_SECOND, rate)) ((GstClockTime) gst_util_uint64_scale_round (frames, GST_SECOND, rate))
/** /**
* GST_CLOCK_TIME_TO_FRAMES: * GST_CLOCK_TIME_TO_FRAMES:
@ -68,7 +68,7 @@ G_BEGIN_DECLS
* Calculate frames from @clocktime and sample @rate. * Calculate frames from @clocktime and sample @rate.
*/ */
#define GST_CLOCK_TIME_TO_FRAMES(clocktime, rate) \ #define GST_CLOCK_TIME_TO_FRAMES(clocktime, rate) \
gst_util_uint64_scale (clocktime, rate, GST_SECOND) gst_util_uint64_scale_round (clocktime, rate, GST_SECOND)
/** /**
* GST_AUDIO_DEF_RATE: * GST_AUDIO_DEF_RATE: