summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-01-01 19:22:45 +0100
committerMax Kellermann <max@musicpd.org>2018-01-02 23:15:51 +0100
commit6d0d8cf9cf07a5d0905f715be9a79f5de86e8b37 (patch)
tree2fd9692a25b7e80ed67320a395bf0bbed1f9f91c /test
parent14f669f4fbac72833e622f66f81950b4be3e3c12 (diff)
filter/Filter: add virtual method Flush()
This will be used by filters which have internal buffers which need to be flushed at the end, e.g. the "soxr" resampler.
Diffstat (limited to 'test')
-rw-r--r--test/run_convert.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/run_convert.cxx b/test/run_convert.cxx
index 1d11e44d0..64ca98bcc 100644
--- a/test/run_convert.cxx
+++ b/test/run_convert.cxx
@@ -86,6 +86,15 @@ try {
output.size);
}
+ while (true) {
+ auto output = state.Flush();
+ if (output.IsNull())
+ break;
+
+ gcc_unused ssize_t ignored = write(1, output.data,
+ output.size);
+ }
+
state.Close();
return EXIT_SUCCESS;