[rhythmbox] song-info: use rb_make_duration_string to format the duration
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] song-info: use rb_make_duration_string to format the duration
- Date: Sun, 3 Oct 2021 12:09:36 +0000 (UTC)
commit f24f8f8ffad35523f3f205a848a6b0cf519f9221
Author: Jonathan Matthew <jonathan d14n org>
Date: Sun Oct 3 22:09:05 2021 +1000
song-info: use rb_make_duration_string to format the duration
widgets/rb-song-info.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/widgets/rb-song-info.c b/widgets/rb-song-info.c
index 202f3d36e..0919be081 100644
--- a/widgets/rb-song-info.c
+++ b/widgets/rb-song-info.c
@@ -1244,13 +1244,12 @@ rb_song_info_update_bitrate (RBSongInfo *song_info)
static void
rb_song_info_update_duration (RBSongInfo *song_info)
{
- char *text = NULL;
- long duration = 0;
- int minutes, seconds;
+ char *text;
+ long duration;
+
duration = rhythmdb_entry_get_ulong (song_info->priv->current_entry, RHYTHMDB_PROP_DURATION);
- minutes = duration / 60;
- seconds = duration % 60;
- text = g_strdup_printf ("%d:%02d", minutes, seconds);
+
+ text = rb_make_duration_string (duration);
gtk_label_set_text (GTK_LABEL (song_info->priv->duration), text);
g_free (text);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]