From b13d656f811d318ba37002cf18ddc3d85f0e2f1d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 23 Oct 2008 20:01:08 +0200 Subject: pcm_resample: don't hard-code sample size Use sizeof(sample) instead of hard-coding "2". Although we're in 16 bit right now, this will make code sharing easier when we support other sample sizes. --- src/pcm_resample_fallback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pcm_resample_fallback.c') diff --git a/src/pcm_resample_fallback.c b/src/pcm_resample_fallback.c index 4ab58616..c5c4ae08 100644 --- a/src/pcm_resample_fallback.c +++ b/src/pcm_resample_fallback.c @@ -30,7 +30,7 @@ pcm_resample_16(uint8_t channels, mpd_unused struct pcm_resample_state *state) { unsigned src_pos, dest_pos = 0; - unsigned dest_samples = dest_size / 2; + unsigned dest_samples = dest_size / sizeof(*dest_buffer); int16_t lsample, rsample; switch (channels) { -- cgit v1.2.3