From b9de3270f69785077f0bb861a15e84f8f669e61d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 11 Jul 2016 23:33:23 +0200 Subject: [PATCH] decoder/flac: specialize "stereo" for all bit depths --- src/decoder/plugins/FlacPcm.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/decoder/plugins/FlacPcm.cxx b/src/decoder/plugins/FlacPcm.cxx index b3c4bc270..a848aa4d4 100644 --- a/src/decoder/plugins/FlacPcm.cxx +++ b/src/decoder/plugins/FlacPcm.cxx @@ -47,7 +47,10 @@ static void FlacImport(T *dest, const FLAC__int32 *const src[], size_t n_frames, unsigned n_channels) { - FlacImportAny(dest, src, n_frames, n_channels); + if (n_channels == 2) + FlacImportStereo(dest, src, n_frames); + else + FlacImportAny(dest, src, n_frames, n_channels); } void @@ -58,10 +61,7 @@ flac_convert(void *dest, { switch (sample_format) { case SampleFormat::S16: - if (num_channels == 2) - FlacImportStereo((int16_t *)dest, buf, n_frames); - else - FlacImportAny((int16_t *)dest, buf, n_frames, num_channels); + FlacImport((int16_t *)dest, buf, n_frames, num_channels); break; case SampleFormat::S24_P32: