diff --git a/ChangeLog b/ChangeLog index fba1e7b940..fcda2a3979 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-08-17 Sebastian Dröge + + * gst-libs/gst/audio/audio.h: + Use gst_util_uint64_scale() instead of doing the math + with double for GST_FRAMES_TO_CLOCK_TIME() and + GST_CLOCK_TIME_TO_FRAMES(). For large timestamps this + prevents rounding errors. Fixes #467667. + 2007-08-17 Wim Taymans * gst-libs/gst/rtsp/gstrtspconnection.c: diff --git a/gst-libs/gst/audio/audio.h b/gst-libs/gst/audio/audio.h index 01eca757c8..e764ae1341 100644 --- a/gst-libs/gst/audio/audio.h +++ b/gst-libs/gst/audio/audio.h @@ -58,7 +58,7 @@ G_BEGIN_DECLS * Calculate clocktime from sample @frames and @rate. */ #define GST_FRAMES_TO_CLOCK_TIME(frames, rate) \ - ((GstClockTime) (((gdouble) frames / rate) * GST_SECOND)) + ((GstClockTime) gst_util_uint64_scale (frames, GST_SECOND, rate)) /** * GST_CLOCK_TIME_TO_FRAMES: @@ -68,7 +68,7 @@ G_BEGIN_DECLS * Calculate frames from @clocktime and sample @rate. */ #define GST_CLOCK_TIME_TO_FRAMES(clocktime, rate) \ - ((gint64) ((gst_guint64_to_gdouble (clocktime) / GST_SECOND) * rate)) + gst_util_uint64_scale (clocktime, rate, GST_SECOND) /** * GST_AUDIO_DEF_RATE: