diff options
Diffstat (limited to 'src/pcm')
-rw-r--r-- | src/pcm/PcmDop.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pcm/PcmDop.cxx b/src/pcm/PcmDop.cxx index e54276140..d7512d482 100644 --- a/src/pcm/PcmDop.cxx +++ b/src/pcm/PcmDop.cxx @@ -49,16 +49,17 @@ pcm_dsd_to_dop(PcmBuffer &buffer, unsigned channels, const size_t num_src_samples = _src.size; const size_t num_src_frames = num_src_samples / channels; - /* this rounds down and discards the last odd frame; not + /* this rounds down and discards up to 3 odd frames; not elegant, but good enough for now */ - const size_t num_frames = num_src_frames / 2; + const size_t num_dop_quads = num_src_frames / 4; + const size_t num_frames = num_dop_quads * 2; const size_t num_samples = num_frames * channels; uint32_t *const dest0 = (uint32_t *)buffer.GetT<uint32_t>(num_samples), *dest = dest0; auto src = _src.data; - for (size_t i = num_frames / 2; i > 0; --i) { + for (size_t i = num_dop_quads; i > 0; --i) { for (unsigned c = channels; c > 0; --c) { /* each 24 bit sample has 16 DSD sample bits plus the magic 0x05 marker */ |