aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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();