aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-12 16:36:07 +0200
committerMax Kellermann <max@duempel.org>2014-08-12 16:36:07 +0200
commit56f61a6d59cfc6a97005d85599963cafdfdeaba8 (patch)
treec5d4c15e407b5ef6213cc82808af562e2bf85c6d /test
parent4d5f610029f27f0947bd590b32dbd2179ab379e9 (diff)
downloadmpd-56f61a6d59cfc6a97005d85599963cafdfdeaba8.tar.gz
mpd-56f61a6d59cfc6a97005d85599963cafdfdeaba8.tar.xz
mpd-56f61a6d59cfc6a97005d85599963cafdfdeaba8.zip
PcmConvert: Convert() returns ConstBuffer
Diffstat (limited to 'test')
-rw-r--r--test/run_convert.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/run_convert.cxx b/test/run_convert.cxx
index 47d9eae86..8b9b15cf0 100644
--- a/test/run_convert.cxx
+++ b/test/run_convert.cxx
@@ -28,6 +28,7 @@
#include "AudioFormat.hxx"
#include "pcm/PcmConvert.hxx"
#include "config/ConfigGlobal.hxx"
+#include "util/ConstBuffer.hxx"
#include "util/StaticFifoBuffer.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
@@ -48,7 +49,6 @@ config_get_string(gcc_unused enum ConfigOption option,
int main(int argc, char **argv)
{
AudioFormat in_audio_format, out_audio_format;
- const void *output;
if (argc != 3) {
fprintf(stderr,
@@ -104,16 +104,15 @@ int main(int argc, char **argv)
buffer.Consume(src.size);
- size_t length;
- output = state.Convert(src.data, src.size,
- &length, error);
- if (output == NULL) {
+ auto output = state.Convert({src.data, src.size}, error);
+ if (output.IsNull()) {
state.Close();
LogError(error, "Failed to convert");
return EXIT_FAILURE;
}
- gcc_unused ssize_t ignored = write(1, output, length);
+ gcc_unused ssize_t ignored = write(1, output.data,
+ output.size);
}
state.Close();