summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 855877f)
raw | patch | inline | side by side (parent: 855877f)
author | Max Kellermann <max.kellermann@gmail.com> | |
Fri, 10 Mar 2017 20:44:53 +0000 (21:44 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Fri, 10 Mar 2017 20:44:53 +0000 (21:44 +0100) |
src/screen_song.c | patch | blob | history |
diff --git a/src/screen_song.c b/src/screen_song.c
index 973812b4e53d393db8d531e575ad044cf7b63ef6..03dc43d5ef178ff93c78709867fed5508d1cf17c 100644 (file)
--- a/src/screen_song.c
+++ b/src/screen_song.c
return true;
}
+static void
+audio_format_to_string(char *buffer, size_t size,
+ const struct mpd_audio_format *format)
+{
+ g_snprintf(buffer, size, _("%u:%u:%u"),
+ format->sample_rate, format->bits,
+ format->channels);
+}
+
static void
screen_song_update(struct mpdclient *c)
{
mpd_status_get_audio_format(c->status);
if (format) {
char buf[32];
- g_snprintf(buf, sizeof(buf), _("%u:%u:%u"),
- format->sample_rate, format->bits,
- format->channels);
+ audio_format_to_string(buf, sizeof(buf), format);
screen_song_append(_(tag_labels[LABEL_FORMAT]), buf,
max_tag_label_width);
}