pcm/Export: halve the sample rate for DoP

Move this sample rate fixup from the ALSA output plugin to PcmExport,
where it belongs.
This commit is contained in:
Max Kellermann
2017-01-11 00:11:43 +01:00
parent 2b43ceb6c6
commit 9c4df66925
3 changed files with 13 additions and 2 deletions

View File

@@ -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;