aboutsummaryrefslogtreecommitdiffstats
path: root/src/strfsong.c
diff options
context:
space:
mode:
authorAndreas Obergrusberger <tradiaz@yahoo.de>2007-02-16 15:42:08 +0000
committerAndreas Obergrusberger <tradiaz@yahoo.de>2007-02-16 15:42:08 +0000
commitebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec (patch)
treef933858d5f7adbb49ed73e4be6d536eb3963906d /src/strfsong.c
parent35c6c1651c0c5d67a5bbba8bf2b5726ba7721a5d (diff)
downloadmpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.tar.gz
mpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.tar.xz
mpd-ebdf8ae4bf442b994ba5dedf3efe22ffe8fc9aec.zip
way too much stuff to describe here
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/strfsong.c')
-rw-r--r--src/strfsong.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/strfsong.c b/src/strfsong.c
index 287fcbdce..df622a2bb 100644
--- a/src/strfsong.c
+++ b/src/strfsong.c
@@ -204,9 +204,21 @@ _strfsong(gchar *s,
else if (strncmp("%time%", p, n) == 0)
{
if (song->time != MPD_SONG_NO_TIME)
- temp = g_strdup_printf("%d:%02d",
- song->time / 60,
- song->time % 60 + 1);
+ {
+ if (song->time > 3600)
+ {
+ temp = g_strdup_printf("%d:%02d:%02d",
+ song->time / 3600,
+ (song->time % 3600) / 60,
+ song->time % 60);
+ }
+ else
+ {
+ temp = g_strdup_printf("%d:%02d",
+ song->time / 60,
+ song->time % 60);
+ }
+ }
}
if( temp == NULL)