aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-03-21 10:01:38 +0100
committerMax Kellermann <max@duempel.org>2012-03-21 10:33:43 +0100
commita29c64b6c76a115ce84dc7be482f18b6e98f30be (patch)
treef42395a63ef8d7c6c0b64b4ce15f19e48f91f691
parent777e1cabc591a146be2c60129b87689021acf3c3 (diff)
downloadmpd-a29c64b6c76a115ce84dc7be482f18b6e98f30be.tar.gz
mpd-a29c64b6c76a115ce84dc7be482f18b6e98f30be.tar.xz
mpd-a29c64b6c76a115ce84dc7be482f18b6e98f30be.zip
audio_format: hack for DSD to USB conversion
Halve the sample rate for *:dsdusb:*.
Diffstat (limited to '')
-rw-r--r--src/audio_format.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/audio_format.c b/src/audio_format.c
index 658197528..06dee8e0f 100644
--- a/src/audio_format.c
+++ b/src/audio_format.c
@@ -35,6 +35,15 @@ audio_format_mask_apply(struct audio_format *af,
assert(audio_format_valid(af));
assert(audio_format_mask_valid(mask));
+ if (af->format == SAMPLE_FORMAT_DSD &&
+ mask->format == SAMPLE_FORMAT_DSD_OVER_USB &&
+ mask->sample_rate == 0)
+ /* each DSD-over-USB sample contains 2 DSD bytes (16
+ DSD bits), which means the sample rate must be
+ halved; this is not the real 1 bit sample rate, but
+ MPD's point of view */
+ af->sample_rate /= 2;
+
if (mask->sample_rate != 0)
af->sample_rate = mask->sample_rate;