From: Max Kellermann Date: Fri, 10 Mar 2017 20:48:52 +0000 (+0100) Subject: screen_song: show "f" and "dsd" formats X-Git-Tag: v0.26~72 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ced48779aaa0408b6ff9ed558aca9d0e12be2400;p=ncmpc.git screen_song: show "f" and "dsd" formats --- diff --git a/NEWS b/NEWS index a4c5075..58f1b88 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ncmpc 0.26 - not yet released * require libmpdclient 2.9 * adapt to lirc 0.9.4 * lyricswiki: update regex +* screen_song: show "f" and "dsd" formats * fix gcc 7 warnings ncmpc 0.25 - (2016-08-18) diff --git a/src/screen_song.c b/src/screen_song.c index 03dc43d..8250f16 100644 --- a/src/screen_song.c +++ b/src/screen_song.c @@ -369,6 +369,22 @@ static void audio_format_to_string(char *buffer, size_t size, const struct mpd_audio_format *format) { +#if LIBMPDCLIENT_CHECK_VERSION(2,10,0) + if (format->bits == MPD_SAMPLE_FORMAT_FLOAT) { + g_snprintf(buffer, size, _("%u:f:%u"), + format->sample_rate, + format->channels); + return; + } + + if (format->bits == MPD_SAMPLE_FORMAT_DSD) { + g_snprintf(buffer, size, _("%u:dsd:%u"), + format->sample_rate, + format->channels); + return; + } +#endif + g_snprintf(buffer, size, _("%u:%u:%u"), format->sample_rate, format->bits, format->channels);