Commit b772f262 authored by Max Kellermann's avatar Max Kellermann

test/software_volume: fixed audio_format parser

Assign default value only if none was given on the command line.
parent c33bbd94
...@@ -42,7 +42,7 @@ int main(int argc, char **argv) ...@@ -42,7 +42,7 @@ int main(int argc, char **argv)
ssize_t nbytes; ssize_t nbytes;
if (argc > 2) { if (argc > 2) {
g_printerr("Usage: software_voluem [FORMAT] <IN >OUT\n"); g_printerr("Usage: software_volume [FORMAT] <IN >OUT\n");
return 1; return 1;
} }
...@@ -54,8 +54,8 @@ int main(int argc, char **argv) ...@@ -54,8 +54,8 @@ int main(int argc, char **argv)
error->message); error->message);
return 1; return 1;
} }
} } else
audio_format_init(&audio_format, 48000, 16, 2); audio_format_init(&audio_format, 48000, 16, 2);
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) { while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
pcm_volume(buffer, nbytes, &audio_format, PCM_VOLUME_1 / 2); pcm_volume(buffer, nbytes, &audio_format, PCM_VOLUME_1 / 2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment