aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_resample_fallback.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-23 20:01:08 +0200
committerMax Kellermann <max@duempel.org>2008-10-23 20:01:08 +0200
commitb13d656f811d318ba37002cf18ddc3d85f0e2f1d (patch)
tree0cb17c41caae994c8d47d81efd4eac128c95a8f3 /src/pcm_resample_fallback.c
parent6b1c54ef9646abddfbd4960c207b32426300a90c (diff)
downloadmpd-b13d656f811d318ba37002cf18ddc3d85f0e2f1d.tar.gz
mpd-b13d656f811d318ba37002cf18ddc3d85f0e2f1d.tar.xz
mpd-b13d656f811d318ba37002cf18ddc3d85f0e2f1d.zip
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.
Diffstat (limited to '')
-rw-r--r--src/pcm_resample_fallback.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcm_resample_fallback.c b/src/pcm_resample_fallback.c
index 4ab586160..c5c4ae08c 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) {