From 53bfaecd40aa7b34dcc9c90064e36f2ffe227fc0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 1 Sep 2012 21:59:13 +0200 Subject: core: remove duplicated format_time() functions This was an on-going transition to make mplayer format all times in the same format. --- mplayer.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index 5b02e33588..66b5a236a7 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1151,20 +1151,9 @@ static void saddf(char *buf, int len, const char *format, ...) */ static void sadd_hhmmssff(char *buf, int len, double time, bool fractions) { - if (time < 0) { - saddf(buf, len, "unknown"); - return; - } - int h, m, s = time; - h = s / 3600; - s -= h * 3600; - m = s / 60; - s -= m * 60; - saddf(buf, len, "%02d:", h); - saddf(buf, len, "%02d:", m); - saddf(buf, len, "%02d", s); - if (fractions) - saddf(buf, len, ".%02d", (int)((time - (int)time) * 100)); + char *s = mp_format_time(time, fractions); + saddf(buf, len, "%s", s); + talloc_free(s); } static void sadd_percentage(char *buf, int len, int percent) { -- cgit v1.2.3