aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_convert.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-07 23:56:35 +0100
committerMax Kellermann <max@duempel.org>2009-01-07 23:56:35 +0100
commitaab85577bf7576895ccae0403d5cb95aa113f7f0 (patch)
tree587622c9ddd091c2d81926fe0aab05614ee357d9 /src/pcm_convert.c
parent5fe7e3bc1465a1a5f618b50f87aa0266d22ec75e (diff)
downloadmpd-aab85577bf7576895ccae0403d5cb95aa113f7f0.tar.gz
mpd-aab85577bf7576895ccae0403d5cb95aa113f7f0.tar.xz
mpd-aab85577bf7576895ccae0403d5cb95aa113f7f0.zip
pcm_channels: use pcm_buffer
Replace a "static" buffer with the PCM buffer library.
Diffstat (limited to '')
-rw-r--r--src/pcm_convert.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pcm_convert.c b/src/pcm_convert.c
index e0ab4ecd3..b9db24b9a 100644
--- a/src/pcm_convert.c
+++ b/src/pcm_convert.c
@@ -37,6 +37,7 @@ void pcm_convert_init(struct pcm_convert_state *state)
pcm_dither_24_init(&state->dither);
pcm_buffer_init(&state->format_buffer);
+ pcm_buffer_init(&state->channels_buffer);
}
void pcm_convert_deinit(struct pcm_convert_state *state)
@@ -44,6 +45,7 @@ void pcm_convert_deinit(struct pcm_convert_state *state)
pcm_resample_deinit(&state->resample);
pcm_buffer_deinit(&state->format_buffer);
+ pcm_buffer_deinit(&state->channels_buffer);
}
static size_t
@@ -66,7 +68,8 @@ pcm_convert_16(const struct audio_format *src_format,
g_error("pcm_convert_to_16() failed");
if (src_format->channels != dest_format->channels) {
- buf = pcm_convert_channels_16(dest_format->channels,
+ buf = pcm_convert_channels_16(&state->channels_buffer,
+ dest_format->channels,
src_format->channels,
buf, len, &len);
if (!buf)
@@ -106,7 +109,8 @@ pcm_convert_24(const struct audio_format *src_format,
g_error("pcm_convert_to_24() failed");
if (src_format->channels != dest_format->channels) {
- buf = pcm_convert_channels_24(dest_format->channels,
+ buf = pcm_convert_channels_24(&state->channels_buffer,
+ dest_format->channels,
src_format->channels,
buf, len, &len);
if (!buf)