summaryrefslogtreecommitdiff
path: root/test/software_volume.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-07-05 19:03:00 +0200
committerMax Kellermann <max@musicpd.org>2019-07-05 19:03:00 +0200
commit5fa76102642a6faf043922e0e60f0b1cae1d84da (patch)
tree4bbc418b42eb09c01bc6081674f6dae20d41b9b0 /test/software_volume.cxx
parent1c757f8c1c5b88f195c29c0fb8a7f8266d9cc984 (diff)
pcm/Volume: Open() returns output sample format
Prepare for a new mode which may convert to a different sample format when applying volume, to reduce dithering.
Diffstat (limited to 'test/software_volume.cxx')
-rw-r--r--test/software_volume.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/software_volume.cxx b/test/software_volume.cxx
index 4c21b4418..17b9b7167 100644
--- a/test/software_volume.cxx
+++ b/test/software_volume.cxx
@@ -50,7 +50,11 @@ try {
audio_format = ParseAudioFormat(argv[1], false);
PcmVolume pv;
- pv.Open(audio_format.format);
+ const auto out_sample_format = pv.Open(audio_format.format);
+
+ if (out_sample_format != audio_format.format)
+ fprintf(stderr, "Converting to %s\n",
+ sample_format_to_string(out_sample_format));
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
auto dest = pv.Apply({buffer, size_t(nbytes)});