From 56f61a6d59cfc6a97005d85599963cafdfdeaba8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 12 Aug 2014 16:36:07 +0200 Subject: PcmConvert: Convert() returns ConstBuffer --- test/run_convert.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'test/run_convert.cxx') 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(); -- cgit v1.2.3