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.
This commit is contained in:
Max Kellermann
2008-10-23 20:01:08 +02:00
parent 6b1c54ef96
commit b13d656f81
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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) {