Commit a29c64b6 authored by Max Kellermann's avatar Max Kellermann

audio_format: hack for DSD to USB conversion

Halve the sample rate for *:dsdusb:*.
parent 777e1cab
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment