Code

screen_song: show "f" and "dsd" formats
authorMax Kellermann <max.kellermann@gmail.com>
Fri, 10 Mar 2017 20:48:52 +0000 (21:48 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Fri, 10 Mar 2017 20:48:52 +0000 (21:48 +0100)
NEWS
src/screen_song.c

diff --git a/NEWS b/NEWS
index a4c5075057e3e5d833092bdfaa4dd7fcdc9644f0..58f1b88327ea0b7042d0bb817bf1d20429e0e443 100644 (file)
--- 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)
index 03dc43d5ef178ff93c78709867fed5508d1cf17c..8250f1623d6949389b40df3cecc3ceab203fce84 100644 (file)
@@ -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);