diff --git a/src/strfsong.c b/src/strfsong.c
index ff1d6ad6b31931bea0cb9ea22e38ee47e00df099..a146583516553754d14d4c9da03f6362de858db3 100644 (file)
--- a/src/strfsong.c
+++ b/src/strfsong.c
#include "strfsong.h"
#include "charset.h"
+#include "utils.h"
#include <mpd/client.h>
unsigned duration = mpd_song_get_duration(song);
if (duration > 0) {
- if (duration > 3600) {
- temp = g_strdup_printf("%d:%02d:%02d",
- duration / 3600,
- (duration % 3600) / 60,
- duration % 60);
- } else {
- temp = g_strdup_printf("%d:%02d",
- duration / 60,
- duration % 60);
- }
+ char buffer[32];
+ format_duration_short(buffer, sizeof(buffer),
+ duration);
+ temp = g_strdup(buffer);
}
}