diff options
author | Max Kellermann <max@duempel.org> | 2013-08-03 21:00:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-03 21:37:56 +0200 |
commit | d1e7b4e38136f9342aad76c685a13adf0e69f869 (patch) | |
tree | 49643b937ddfe735511b566a71398da5a945d7aa /test/run_encoder.cxx | |
parent | 67f591a9ce60651da41afc499bd9a22e25314e35 (diff) |
audio_format: convert to C++
Diffstat (limited to 'test/run_encoder.cxx')
-rw-r--r-- | test/run_encoder.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/run_encoder.cxx b/test/run_encoder.cxx index 1beb434df..4b1521b99 100644 --- a/test/run_encoder.cxx +++ b/test/run_encoder.cxx @@ -20,7 +20,7 @@ #include "config.h" #include "EncoderList.hxx" #include "EncoderPlugin.hxx" -#include "audio_format.h" +#include "AudioFormat.hxx" #include "AudioParser.hxx" #include "conf.h" #include "stdbin.h" @@ -44,7 +44,6 @@ encoder_to_stdout(Encoder &encoder) int main(int argc, char **argv) { GError *error = NULL; - struct audio_format audio_format; bool ret; const char *encoder_name; static char buffer[32768]; @@ -61,8 +60,6 @@ int main(int argc, char **argv) else encoder_name = "vorbis"; - audio_format_init(&audio_format, 44100, SAMPLE_FORMAT_S16, 2); - /* create the encoder */ const auto plugin = encoder_plugin_get(encoder_name); @@ -84,8 +81,9 @@ int main(int argc, char **argv) /* open the encoder */ + AudioFormat audio_format(44100, SampleFormat::S16, 2); if (argc > 2) { - ret = audio_format_parse(&audio_format, argv[2], + ret = audio_format_parse(audio_format, argv[2], false, &error); if (!ret) { g_printerr("Failed to parse audio format: %s\n", @@ -95,7 +93,7 @@ int main(int argc, char **argv) } } - if (!encoder_open(encoder, &audio_format, &error)) { + if (!encoder_open(encoder, audio_format, &error)) { g_printerr("Failed to open encoder: %s\n", error->message); g_error_free(error); |