From a29c64b6c76a115ce84dc7be482f18b6e98f30be Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 21 Mar 2012 10:01:38 +0100 Subject: audio_format: hack for DSD to USB conversion Halve the sample rate for *:dsdusb:*. --- src/audio_format.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/audio_format.c b/src/audio_format.c index 65819752..06dee8e0 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; -- cgit v1.2.3