From fca6b63ef7310a36010d843f295e37ec368febf8 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sun, 30 Oct 2005 22:06:42 +0000 Subject: [PATCH] Fix bug with FLAC and ALAC output being half the correct volume. The DSP_SET_SAMPLE_DEPTH function expects needs clarifying or changing - it seems to expect one less than the number of bits in cases where the depth is greater than the native depth (16 bits). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7692 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/alac.c | 4 ++-- apps/codecs/flac.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c index c96d1f0405..af2694851f 100644 --- a/apps/codecs/alac.c +++ b/apps/codecs/alac.c @@ -64,8 +64,8 @@ enum codec_status codec_start(struct codec_api* api) ci->configure(CODEC_DSP_ENABLE, (bool *)true); ci->configure(DSP_DITHER, (bool *)false); ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_NONINTERLEAVED); - ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(28)); - + ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(ALAC_OUTPUT_DEPTH-1)); + next_track: if (codec_init(api)) { diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c index bbd45ece89..81785132a9 100644 --- a/apps/codecs/flac.c +++ b/apps/codecs/flac.c @@ -240,7 +240,7 @@ enum codec_status codec_start(struct codec_api* api) ci->configure(CODEC_DSP_ENABLE, (bool *)true); ci->configure(DSP_DITHER, (bool *)false); ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_NONINTERLEAVED); - ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(28)); + ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(FLAC_OUTPUT_DEPTH-1)); next_track: