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.
This commit is contained in:
Max Kellermann
2018-01-01 19:22:45 +01:00
parent 14f669f4fb
commit 6d0d8cf9cf
9 changed files with 134 additions and 7 deletions

View File

@@ -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;