aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-30 21:27:37 +0100
committerMax Kellermann <max@duempel.org>2013-01-30 21:39:43 +0100
commitcfeeb7af2e398b94db6db84c208976588d8cfcda (patch)
tree19635e8dc5fdcd54ff838def22e74de5ffffb13e /test
parentac887d3afb9aba509ddf2da034e089e86b761c3d (diff)
test/run_encoder, ...: convert to C++
Diffstat (limited to 'test')
-rw-r--r--test/run_convert.cxx (renamed from test/run_convert.c)2
-rw-r--r--test/run_encoder.cxx (renamed from test/run_encoder.c)4
-rw-r--r--test/software_volume.cxx (renamed from test/software_volume.c)5
3 files changed, 6 insertions, 5 deletions
diff --git a/test/run_convert.c b/test/run_convert.cxx
index bdb3d2cf..a71ebc2c 100644
--- a/test/run_convert.c
+++ b/test/run_convert.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/test/run_encoder.c b/test/run_encoder.cxx
index db4d3af9..6a141296 100644
--- a/test/run_encoder.c
+++ b/test/run_encoder.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -51,7 +51,6 @@ int main(int argc, char **argv)
struct encoder *encoder;
struct config_param *param;
static char buffer[32768];
- ssize_t nbytes;
/* parse command line */
@@ -110,6 +109,7 @@ int main(int argc, char **argv)
/* do it */
+ ssize_t nbytes;
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
ret = encoder_write(encoder, buffer, nbytes, &error);
if (!ret) {
diff --git a/test/software_volume.c b/test/software_volume.cxx
index 2357da67..18068665 100644
--- a/test/software_volume.c
+++ b/test/software_volume.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -59,7 +59,8 @@ int main(int argc, char **argv)
audio_format_init(&audio_format, 48000, SAMPLE_FORMAT_S16, 2);
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
- if (!pcm_volume(buffer, nbytes, audio_format.format,
+ if (!pcm_volume(buffer, nbytes,
+ sample_format(audio_format.format),
PCM_VOLUME_1 / 2)) {
g_printerr("pcm_volume() has failed\n");
return 2;