diff options
author | Max Kellermann <max@duempel.org> | 2014-08-12 16:09:07 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-12 16:40:51 +0200 |
commit | 7244dc45110118631c16448907c344163bcb402c (patch) | |
tree | cd6a05d27069d6f5234cb8f0af7c7c5034362cef /src/filter/plugins/AutoConvertFilterPlugin.cxx | |
parent | 56f61a6d59cfc6a97005d85599963cafdfdeaba8 (diff) | |
download | mpd-7244dc45110118631c16448907c344163bcb402c.tar.gz mpd-7244dc45110118631c16448907c344163bcb402c.tar.xz mpd-7244dc45110118631c16448907c344163bcb402c.zip |
Filter: FilterPCM() returns ConstBuffer
API simplification. We can now avoid abusing a "size_t*" as
additional return value.
Diffstat (limited to '')
-rw-r--r-- | src/filter/plugins/AutoConvertFilterPlugin.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/filter/plugins/AutoConvertFilterPlugin.cxx b/src/filter/plugins/AutoConvertFilterPlugin.cxx index cdeeefdc6..8586cb86e 100644 --- a/src/filter/plugins/AutoConvertFilterPlugin.cxx +++ b/src/filter/plugins/AutoConvertFilterPlugin.cxx @@ -25,6 +25,7 @@ #include "filter/FilterRegistry.hxx" #include "AudioFormat.hxx" #include "config/ConfigData.hxx" +#include "util/ConstBuffer.hxx" #include <assert.h> @@ -48,9 +49,8 @@ public: virtual AudioFormat Open(AudioFormat &af, Error &error) override; virtual void Close() override; - virtual const void *FilterPCM(const void *src, size_t src_size, - size_t *dest_size_r, - Error &error) override; + virtual ConstBuffer<void> FilterPCM(ConstBuffer<void> src, + Error &error) override; }; AudioFormat @@ -111,17 +111,16 @@ AutoConvertFilter::Close() filter->Close(); } -const void * -AutoConvertFilter::FilterPCM(const void *src, size_t src_size, - size_t *dest_size_r, Error &error) +ConstBuffer<void> +AutoConvertFilter::FilterPCM(ConstBuffer<void> src, Error &error) { if (convert != nullptr) { - src = convert->FilterPCM(src, src_size, &src_size, error); - if (src == nullptr) + src = convert->FilterPCM(src, error); + if (src.IsNull()) return nullptr; } - return filter->FilterPCM(src, src_size, dest_size_r, error); + return filter->FilterPCM(src, error); } Filter * |