From 0e9c0e8aa2aa7df6aad5d78c4b664927a9d2421e Mon Sep 17 00:00:00 2001 From: arpi Date: Sat, 28 Dec 2002 13:53:31 +0000 Subject: [PATCH] This patch makes subtitle and A-V delays display correctly rounded ("3800 ms" instead of "3799 ms" etc). Oskar Liljeblad git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8607 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mplayer.c b/mplayer.c index 620ba67a66..e06c301307 100644 --- a/mplayer.c +++ b/mplayer.c @@ -80,6 +80,7 @@ int identify=0; static int quiet=0; #define ABS(x) (((x)>=0)?(x):(-(x))) +#define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5)) #ifdef HAVE_RTC #include @@ -2925,7 +2926,7 @@ if(rel_seek_secs || abs_seek_pos){ osd_show_vobsub_changed--; } else if (osd_show_sub_delay) { - sprintf(osd_text_tmp, "Sub delay: %d ms",(int)(sub_delay*1000)); + sprintf(osd_text_tmp, "Sub delay: %d ms %.10f", ROUND(sub_delay*1000)); osd_show_sub_delay--; } else if (osd_show_sub_pos) { @@ -2939,7 +2940,7 @@ if(rel_seek_secs || abs_seek_pos){ osd_show_sub_alignment--; } else if (osd_show_av_delay) { - sprintf(osd_text_tmp, "A-V delay: %d ms",(int)(audio_delay*1000)); + sprintf(osd_text_tmp, "A-V delay: %d ms", ROUND(audio_delay*1000)); osd_show_av_delay--; } else if(osd_level>=2) sprintf(osd_text_tmp,"%c %02d:%02d:%02d",osd_function,pts/3600,(pts/60)%60,pts%60);