aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_convert.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcm_convert.c')
-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)