From bcab29d53a8981993444c5d5fda642bc82ccd73f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 5 Nov 2024 13:16:28 +0100 Subject: [PATCH] filter/Filter: Flush() returns empty span, not nullptr --- src/filter/Filter.hxx | 2 +- src/output/Thread.cxx | 2 +- test/run_filter.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filter/Filter.hxx b/src/filter/Filter.hxx index b533965d4..ed82a2a19 100644 --- a/src/filter/Filter.hxx +++ b/src/filter/Filter.hxx @@ -49,7 +49,7 @@ public: /** * Flush pending data and return it. This should be called - * repeatedly until it returns nullptr. + * repeatedly until it returns an empty span. * * After calling this method, this object cannot be used again * (not even Reset() is allowed). diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx index e1c3ed477..fd6ee3ef3 100644 --- a/src/output/Thread.cxx +++ b/src/output/Thread.cxx @@ -389,7 +389,7 @@ AudioOutputControl::InternalDrain() noexcept while (true) { auto buffer = source.Flush(); - if (buffer.data() == nullptr) + if (buffer.empty()) break; PlayFull(*output, buffer); diff --git a/test/run_filter.cxx b/test/run_filter.cxx index eab1dd692..2c318b7c4 100644 --- a/test/run_filter.cxx +++ b/test/run_filter.cxx @@ -128,7 +128,7 @@ try { while (true) { auto dest = filter->Flush(); - if (dest.data() == nullptr) + if (dest.empty()) break; output_fd.FullWrite(dest); }