summaryrefslogtreecommitdiff
path: root/test/run_convert.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-30 23:40:56 +0100
committerMax Kellermann <max@duempel.org>2013-01-31 00:26:55 +0100
commit361404fd59e817560e4564f15466e94c2a0d7551 (patch)
tree2e8eab59d93b24e496576be0ccdcfc3bf70d54bf /test/run_convert.cxx
parent762c91b7f1024ff81d3dd39b217995d817030ef8 (diff)
pcm_convert: convert to C++
Diffstat (limited to 'test/run_convert.cxx')
-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 1e54f2d35..e66d0be2b 100644
--- a/test/run_convert.cxx
+++ b/test/run_convert.cxx
@@ -26,7 +26,7 @@
#include "config.h"
#include "AudioParser.hxx"
#include "audio_format.h"
-#include "pcm_convert.h"
+#include "PcmConvert.hxx"
#include "conf.h"
#include "util/fifo_buffer.h"
#include "stdbin.h"
@@ -58,7 +58,6 @@ int main(int argc, char **argv)
{
GError *error = NULL;
struct audio_format in_audio_format, out_audio_format;
- struct pcm_convert_state state;
const void *output;
ssize_t nbytes;
size_t length;
@@ -90,7 +89,7 @@ int main(int argc, char **argv)
const size_t in_frame_size = audio_format_frame_size(&in_audio_format);
- pcm_convert_init(&state);
+ PcmConvert state;
struct fifo_buffer *buffer = fifo_buffer_new(4096);
@@ -113,8 +112,8 @@ int main(int argc, char **argv)
fifo_buffer_consume(buffer, length);
- output = pcm_convert(&state, &in_audio_format, src, length,
- &out_audio_format, &length, &error);
+ output = state.Convert(&in_audio_format, src, length,
+ &out_audio_format, &length, &error);
if (output == NULL) {
g_printerr("Failed to convert: %s\n", error->message);
return 2;
@@ -123,5 +122,5 @@ int main(int argc, char **argv)
G_GNUC_UNUSED ssize_t ignored = write(1, output, length);
}
- pcm_convert_deinit(&state);
+ return EXIT_SUCCESS;
}