diff options
author | Max Kellermann <max@duempel.org> | 2013-07-29 08:10:10 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-07-30 08:31:02 +0200 |
commit | c75cb67c4406648314ce2a15daf8b632374d7913 (patch) | |
tree | 5e27b73f2c90e878631bfac5b60070505b094717 /src/filter/RouteFilterPlugin.cxx | |
parent | cd1bb2bafa2653e5d4c7c9abf6f464bcdec693c5 (diff) | |
download | mpd-c75cb67c4406648314ce2a15daf8b632374d7913.tar.gz mpd-c75cb67c4406648314ce2a15daf8b632374d7913.tar.xz mpd-c75cb67c4406648314ce2a15daf8b632374d7913.zip |
pcm_buffer: convert to C++
Diffstat (limited to 'src/filter/RouteFilterPlugin.cxx')
-rw-r--r-- | src/filter/RouteFilterPlugin.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/filter/RouteFilterPlugin.cxx b/src/filter/RouteFilterPlugin.cxx index 85db7e9ea..3dc0991f9 100644 --- a/src/filter/RouteFilterPlugin.cxx +++ b/src/filter/RouteFilterPlugin.cxx @@ -47,7 +47,7 @@ #include "FilterPlugin.hxx" #include "FilterInternal.hxx" #include "FilterRegistry.hxx" -#include "pcm/pcm_buffer.h" +#include "pcm/PcmBuffer.hxx" #include <assert.h> #include <string.h> @@ -101,7 +101,7 @@ class RouteFilter final : public Filter { /** * The output buffer used last time around, can be reused if the size doesn't differ. */ - struct pcm_buffer output_buffer; + PcmBuffer output_buffer; public: RouteFilter():sources(nullptr) {} @@ -256,16 +256,13 @@ RouteFilter::Open(audio_format &audio_format, gcc_unused GError **error_r) // Precalculate this simple value, to speed up allocation later output_frame_size = audio_format_frame_size(&output_format); - // This buffer grows as needed - pcm_buffer_init(&output_buffer); - return &output_format; } void RouteFilter::Close() { - pcm_buffer_deinit(&output_buffer); + output_buffer.Clear(); } const void * @@ -285,9 +282,7 @@ RouteFilter::FilterPCM(const void *src, size_t src_size, // Grow our reusable buffer, if needed, and set the moving pointer *dest_size_r = number_of_frames * output_frame_size; - chan_destination = (uint8_t *) - pcm_buffer_get(&output_buffer, *dest_size_r); - + chan_destination = (uint8_t *)output_buffer.Get(*dest_size_r); // Perform our copy operations, with N input channels and M output channels for (unsigned int s=0; s<number_of_frames; ++s) { |