From: Max Kellermann Date: Fri, 10 Mar 2017 20:44:53 +0000 (+0100) Subject: screen_song: move code to audio_format_to_string() X-Git-Tag: v0.26~73 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6d5f08886f5cda18061d66d047abcf1553a9048e;p=ncmpc.git screen_song: move code to audio_format_to_string() --- diff --git a/src/screen_song.c b/src/screen_song.c index 973812b..03dc43d 100644 --- a/src/screen_song.c +++ b/src/screen_song.c @@ -365,6 +365,15 @@ screen_song_add_stats(struct mpd_connection *connection) 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) { @@ -410,9 +419,7 @@ 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); }