diff options
Diffstat (limited to 'src/pcm_dither.c')
-rw-r--r-- | src/pcm_dither.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/pcm_dither.c b/src/pcm_dither.c index 03388f0e0..4811946c8 100644 --- a/src/pcm_dither.c +++ b/src/pcm_dither.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2010 The Music Player Daemon Project + * Copyright (C) 2003-2011 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -72,10 +72,9 @@ pcm_dither_sample_24_to_16(int32_t sample, struct pcm_dither *dither) void pcm_dither_24_to_16(struct pcm_dither *dither, - int16_t *dest, const int32_t *src, - unsigned num_samples) + int16_t *dest, const int32_t *src, const int32_t *src_end) { - while (num_samples-- > 0) + while (src < src_end) *dest++ = pcm_dither_sample_24_to_16(*src++, dither); } @@ -87,9 +86,8 @@ pcm_dither_sample_32_to_16(int32_t sample, struct pcm_dither *dither) void pcm_dither_32_to_16(struct pcm_dither *dither, - int16_t *dest, const int32_t *src, - unsigned num_samples) + int16_t *dest, const int32_t *src, const int32_t *src_end) { - while (num_samples-- > 0) + while (src < src_end) *dest++ = pcm_dither_sample_32_to_16(*src++, dither); } |