summaryrefslogtreecommitdiff
path: root/test/run_convert.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'test/run_convert.cxx')
-rw-r--r--test/run_convert.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/run_convert.cxx b/test/run_convert.cxx
index 0e873a3b3..d9a1b7f08 100644
--- a/test/run_convert.cxx
+++ b/test/run_convert.cxx
@@ -90,6 +90,11 @@ int main(int argc, char **argv)
const size_t in_frame_size = in_audio_format.GetFrameSize();
PcmConvert state;
+ if (!state.Open(in_audio_format, out_audio_format_mask, error)) {
+ g_printerr("Failed to open PcmConvert: %s\n",
+ error.GetMessage());
+ return EXIT_FAILURE;
+ }
FifoBuffer<uint8_t, 4096> buffer;
@@ -115,9 +120,10 @@ int main(int argc, char **argv)
buffer.Consume(src.size);
size_t length;
- output = state.Convert(in_audio_format, src.data, src.size,
- out_audio_format, &length, error);
+ output = state.Convert(src.data, src.size,
+ &length, error);
if (output == NULL) {
+ state.Close();
g_printerr("Failed to convert: %s\n", error.GetMessage());
return 2;
}
@@ -125,5 +131,7 @@ int main(int argc, char **argv)
gcc_unused ssize_t ignored = write(1, output, length);
}
+ state.Close();
+
return EXIT_SUCCESS;
}