summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9d872e5)
raw | patch | inline | side by side (parent: 9d872e5)
author | Max Kellermann <max@duempel.org> | |
Wed, 8 Jul 2009 21:07:22 +0000 (23:07 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 8 Jul 2009 21:07:22 +0000 (23:07 +0200) |
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index 23ba656e16a4613c64de169305aa23c2f541d159..f41f32a597e0228a08b8c325df5c057f85948532 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
playlist_repaint_if_active();
}
+static char *
+format_duration(int duration)
+{
+ return g_strdup_printf("%d:%02d", duration / 60, duration % 60);
+}
+
static const char *
list_callback(unsigned idx, bool *highlight, char **second_column, G_GNUC_UNUSED void *data)
{
@@ -116,7 +122,7 @@ list_callback(unsigned idx, bool *highlight, char **second_column, G_GNUC_UNUSED
#ifndef NCMPC_MINI
if(second_column)
- *second_column = g_strdup_printf("%d:%02d", song->time/60, song->time%60);
+ *second_column = format_duration(song->time);
if ((unsigned)song->pos == lw->selected)
{