From 8ed7ba1d7bdb813687805b7f2c2927d08fc86ed4 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 28 Nov 2011 11:16:01 +0000 Subject: [PATCH] Fix fs#12005 - have %pc,%pl and %pr return the number of seconds when used with %if() instead of a formatted time string git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31082 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_tokens.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 48d79600d2..169c4a36fd 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -306,14 +306,20 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, return "?"; return buf; case SKIN_TOKEN_TRACK_TIME_ELAPSED: + if (intval && limit == TOKEN_VALUE_ONLY) + *intval = elapsed/1000; format_time(buf, buf_size, elapsed); return buf; case SKIN_TOKEN_TRACK_TIME_REMAINING: + if (intval && limit == TOKEN_VALUE_ONLY) + *intval = (length - elapsed)/1000; format_time(buf, buf_size, length - elapsed); return buf; case SKIN_TOKEN_TRACK_LENGTH: + if (intval && limit == TOKEN_VALUE_ONLY) + *intval = length/1000; format_time(buf, buf_size, length); return buf;