changeset 34262:aa8061d708b9

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
author cigaes
date Tue, 15 Nov 2011 17:57:23 +0000
parents 4a6b8c6e837a
children 183cab72ca08
files mplayer.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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