From 9c4df669253e1b01f20ff4d496c15a8bed4a00ac Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 11 Jan 2017 00:11:43 +0100 Subject: pcm/Export: halve the sample rate for DoP Move this sample rate fixup from the ALSA output plugin to PcmExport, where it belongs. --- src/pcm/PcmExport.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/pcm/PcmExport.cxx') diff --git a/src/pcm/PcmExport.cxx b/src/pcm/PcmExport.cxx index ed8ab1707..254995d38 100644 --- a/src/pcm/PcmExport.cxx +++ b/src/pcm/PcmExport.cxx @@ -106,6 +106,11 @@ PcmExport::Params::CalcOutputSampleRate(unsigned sample_rate) const /* DSD_U32 combines four 8-bit "samples" in one 32-bit "sample" */ sample_rate /= 4; + + if (dop) + /* DoP packs two 8-bit "samples" in one 24-bit + "sample" */ + sample_rate /= 2; #endif return sample_rate; @@ -117,6 +122,9 @@ PcmExport::Params::CalcInputSampleRate(unsigned sample_rate) const #ifdef ENABLE_DSD if (dsd_u32) sample_rate *= 4; + + if (dop) + sample_rate *= 2; #endif return sample_rate; -- cgit v1.2.3