aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_format.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-19 22:11:50 +0200
committerMax Kellermann <max@duempel.org>2011-10-19 22:13:23 +0200
commit0debe9bd6ffb6f89a0756137837dcdc58fa84de0 (patch)
treee54d9c8ca9f163cc9983d78c439d83972129ed66 /src/pcm_format.c
parentf1da118a6ccec6154a8e67c78d52fffb2ffa7089 (diff)
downloadmpd-0debe9bd6ffb6f89a0756137837dcdc58fa84de0.tar.gz
mpd-0debe9bd6ffb6f89a0756137837dcdc58fa84de0.tar.xz
mpd-0debe9bd6ffb6f89a0756137837dcdc58fa84de0.zip
pcm_utils: add function pcm_end_pointer()
Diffstat (limited to '')
-rw-r--r--src/pcm_format.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pcm_format.c b/src/pcm_format.c
index 148cd70ed..6e1e0906d 100644
--- a/src/pcm_format.c
+++ b/src/pcm_format.c
@@ -22,6 +22,7 @@
#include "pcm_dither.h"
#include "pcm_buffer.h"
#include "pcm_pack.h"
+#include "pcm_utils.h"
static void
pcm_convert_8_to_16(int16_t *out, const int8_t *in,
@@ -61,7 +62,7 @@ pcm_convert_to_16(struct pcm_buffer *buffer, struct pcm_dither *dither,
enum sample_format src_format, const void *src,
size_t src_size, size_t *dest_size_r)
{
- const void *src_end = (const char *)src + src_size;
+ const void *src_end = pcm_end_pointer(src, src_size);
unsigned num_samples;
int16_t *dest;
int32_t *dest32;