summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-07-10 19:53:26 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-07-10 22:58:56 +0300
commitbb6c06d17f661ff99edb0eb1dc9c0a12770f887f (patch)
tree087a3ed68a314c2dd4f2f8613fa2e8d13fa8557c /Makefile
parent3f75062ca65cea46fa9e06ab5f5271ad310440fd (diff)
downloadmpv-bb6c06d17f661ff99edb0eb1dc9c0a12770f887f.tar.bz2
mpv-bb6c06d17f661ff99edb0eb1dc9c0a12770f887f.tar.xz
demux_mkv.c: Make some time arithmetic more precise
Some calculations in the demuxer that are in principle integer arithmetic use float divisions instead of 64-bit integer ones (as in (int64_t)(x / 1000000.0) ). When compiled with -ffast-math gcc replaces the division with multiplication by inverse. The calculation of the inverse can introduce rounding error even for divisions that would have been exact, and any rounding error down from an exact integer result in the division makes the result after cast one smaller. This caused some inaccuracy in seeking due to timecodes in the index not quite matching those calculated for actual packets. Add 0.5 to such expressions before casting to round instead of truncating, which should be enough to avoid the problem. Also replace some non-performance-critical use of float types by doubles.
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions