summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f86f1ad)
raw | patch | inline | side by side (parent: f86f1ad)
author | Max Kellermann <max@duempel.org> | |
Wed, 8 Jul 2009 21:09:30 +0000 (23:09 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 8 Jul 2009 21:09:30 +0000 (23:09 +0200) |
If the song duration is not known (MPD_SONG_NO_TIME), don't attempt to
print -1 in the second column.
print -1 in the second column.
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index f41f32a597e0228a08b8c325df5c057f85948532..e1944663068da3d46aa6f40e5718786c9c1bd39d 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
static char *
format_duration(int duration)
{
+ if (duration == MPD_SONG_NO_TIME)
+ return NULL;
+
return g_strdup_printf("%d:%02d", duration / 60, duration % 60);
}