Skip to content

Commit

Permalink
filter/Filter: Flush() returns empty span, not nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Nov 5, 2024
1 parent d619502 commit bcab29d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/filter/Filter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/output/Thread.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ AudioOutputControl::InternalDrain() noexcept

while (true) {
auto buffer = source.Flush();
if (buffer.data() == nullptr)
if (buffer.empty())
break;

PlayFull(*output, buffer);
Expand Down
2 changes: 1 addition & 1 deletion test/run_filter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ try {

while (true) {
auto dest = filter->Flush();
if (dest.data() == nullptr)
if (dest.empty())
break;
output_fd.FullWrite(dest);
}
Expand Down

0 comments on commit bcab29d

Please sign in to comment.