From: Max Kellermann Date: Fri, 10 Mar 2017 20:50:20 +0000 (+0100) Subject: screen_song: show "dsd64" etc. shortcuts X-Git-Tag: v0.26~71 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=892e95b0536de29c2144c98e92c4c0f78ac04134;p=ncmpc.git screen_song: show "dsd64" etc. shortcuts --- 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);