# HG changeset patch # User cigaes # Date 1321379843 0 # Node ID aa8061d708b91dfdd42e4e538f2eb32c8fd70269 # Parent 4a6b8c6e837a00bb842c823c64ff337599a0e362 OSD fractions: do not round up decimals Currently if the PTS timestamps come in as something like this: 1.95 1.997 2.03 The OSD fraction is displayed like this: 1.95 1.00 2.03 which is less than desirable. Patch by Roger Pack, rogerdpack2 (gmail) http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2011-November/069448.html diff -r 4a6b8c6e837a -r aa8061d708b9 mplayer.c --- a/mplayer.c Mon Nov 14 19:09:35 2011 +0000 +++ b/mplayer.c Tue Nov 15 17:57:23 2011 +0000 @@ -1597,8 +1597,7 @@ if (osd_fractions == 1) { // print fractions as sub-second timestamp snprintf(fractions_text, sizeof(fractions_text), ".%02d", - (int)((mpctx->sh_video->pts - pts) * 100 + 0.5) - % 100); + (int)((mpctx->sh_video->pts - pts) * 100) % 100); } else if (osd_fractions == 2) { // print fractions by estimating the frame count within the // second