From 892e95b0536de29c2144c98e92c4c0f78ac04134 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Mar 2017 21:50:20 +0100 Subject: [PATCH] screen_song: show "dsd64" etc. shortcuts --- src/screen_song.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/screen_song.c b/src/screen_song.c index 8250f16..6814dcd 100644 --- a/src/screen_song.c +++ b/src/screen_song.c @@ -378,6 +378,16 @@ audio_format_to_string(char *buffer, size_t size, } if (format->bits == MPD_SAMPLE_FORMAT_DSD) { + if (format->sample_rate > 0 && + format->sample_rate % 44100 == 0) { + /* use shortcuts such as "dsd64" which implies the + sample rate */ + g_snprintf(buffer, size, _("dsd%u:%u"), + format->sample_rate * 8 / 44100, + format->channels); + return; + } + g_snprintf(buffer, size, _("%u:dsd:%u"), format->sample_rate, format->channels); -- 2.30.2