diff options
author | Max Kellermann <max@duempel.org> | 2009-01-07 23:56:34 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-07 23:56:34 +0100 |
commit | 5fe7e3bc1465a1a5f618b50f87aa0266d22ec75e (patch) | |
tree | 89fdb2c5abc33581b4b5cee4e7cb9e9e548e8276 /src/pcm_convert.c | |
parent | 954c2b5a2518e3e5c2a87595c18320de2cac14d6 (diff) | |
download | mpd-5fe7e3bc1465a1a5f618b50f87aa0266d22ec75e.tar.gz mpd-5fe7e3bc1465a1a5f618b50f87aa0266d22ec75e.tar.xz mpd-5fe7e3bc1465a1a5f618b50f87aa0266d22ec75e.zip |
pcm_format: use the pcm_buffer library
Replace a "static" buffer with the PCM buffer library.
Diffstat (limited to 'src/pcm_convert.c')
-rw-r--r-- | src/pcm_convert.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pcm_convert.c b/src/pcm_convert.c index 13c7405e3..e0ab4ecd3 100644 --- a/src/pcm_convert.c +++ b/src/pcm_convert.c @@ -35,11 +35,15 @@ void pcm_convert_init(struct pcm_convert_state *state) pcm_resample_init(&state->resample); pcm_dither_24_init(&state->dither); + + pcm_buffer_init(&state->format_buffer); } void pcm_convert_deinit(struct pcm_convert_state *state) { pcm_resample_deinit(&state->resample); + + pcm_buffer_deinit(&state->format_buffer); } static size_t @@ -55,8 +59,9 @@ pcm_convert_16(const struct audio_format *src_format, assert(dest_format->bits == 16); - buf = pcm_convert_to_16(&state->dither, src_format->bits, - src_buffer, src_size, &len); + buf = pcm_convert_to_16(&state->format_buffer, &state->dither, + src_format->bits, src_buffer, src_size, + &len); if (!buf) g_error("pcm_convert_to_16() failed"); @@ -95,7 +100,7 @@ pcm_convert_24(const struct audio_format *src_format, assert(dest_format->bits == 24); - buf = pcm_convert_to_24(src_format->bits, + buf = pcm_convert_to_24(&state->format_buffer, src_format->bits, src_buffer, src_size, &len); if (!buf) g_error("pcm_convert_to_24() failed"); |