From 13b9b084c18d675f7ea52b750f22426473888e2a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Jul 2009 23:09:30 +0200 Subject: [PATCH] screen_play: fix duration "0:-1" If the song duration is not known (MPD_SONG_NO_TIME), don't attempt to print -1 in the second column. --- src/screen_play.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/screen_play.c b/src/screen_play.c index f41f32a..e194466 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -99,6 +99,9 @@ playlist_changed_callback(mpdclient_t *c, int event, gpointer data) static char * format_duration(int duration) { + if (duration == MPD_SONG_NO_TIME) + return NULL; + return g_strdup_printf("%d:%02d", duration / 60, duration % 60); } -- 2.30.2