]> git.sesse.net Git - vlc/commit - src/misc/mtime.c
Fix date_Increment when i_divider_den > 1
authorDavid Flynn <davidf@rd.bbc.co.uk>
Thu, 7 Aug 2008 19:39:02 +0000 (19:39 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 10 Aug 2008 21:37:19 +0000 (23:37 +0200)
commit8ee69aa072883ab2659e707152c11fc5ddf22777
tree2a7dc2984fbbbde428c1a43813871891ad052fcd
parent331e10fbd5d8d8e09f4ce97869495a3fc806837d
Fix date_Increment when i_divider_den > 1

Previously, calling date_Increment(d,1) with divider_den > 1 would cause:
 - Uncorrectable rounding error due to ordering of / followed by *
 - If i_divider_num / i_divider_den is not integral, a remainder is
   accumulated, but not divided by i_divider_num when added to date.
 => Both cases are evident with num=30000, den=1001.

This fixes both issues.

Signed-off-by: David Flynn <davidf@rd.bbc.co.uk>
src/misc/mtime.c