Author: cigaes Date: Tue Nov 15 18:57:23 2011 New Revision: 34350 Log: 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.htm... Modified: trunk/mplayer.c Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Mon Nov 14 20:09:35 2011 (r34349) +++ trunk/mplayer.c Tue Nov 15 18:57:23 2011 (r34350) @@ -1597,8 +1597,7 @@ static void update_osd_msg(void) 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
participants (1)
-
cigaes