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/ChainFilterPlugin.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/ChainFilterPlugin.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/filter/plugins/ChainFilterPlugin.cxx b/src/filter/plugins/ChainFilterPlugin.cxx index 7dc6db667..7342beb14 100644 --- a/src/filter/plugins/ChainFilterPlugin.cxx +++ b/src/filter/plugins/ChainFilterPlugin.cxx @@ -25,6 +25,7 @@ #include "AudioFormat.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" +#include "util/ConstBuffer.hxx" #include <list> @@ -54,8 +55,8 @@ public: virtual AudioFormat Open(AudioFormat &af, Error &error) override; virtual void Close(); - virtual const void *FilterPCM(const void *src, size_t src_size, - size_t *dest_size_r, Error &error); + virtual ConstBuffer<void> FilterPCM(ConstBuffer<void> src, + Error &error); private: /** @@ -143,21 +144,18 @@ ChainFilter::Close() child.filter->Close(); } -const void * -ChainFilter::FilterPCM(const void *src, size_t src_size, - size_t *dest_size_r, Error &error) +ConstBuffer<void> +ChainFilter::FilterPCM(ConstBuffer<void> src, Error &error) { for (auto &child : children) { /* feed the output of the previous filter as input into the current one */ - src = child.filter->FilterPCM(src, src_size, &src_size, - error); - if (src == nullptr) + src = child.filter->FilterPCM(src, error); + if (src.IsNull()) return nullptr; } /* return the output of the last filter */ - *dest_size_r = src_size; return src; } |