output/Source: move code to DropCurrentChunk()
This commit is contained in:
parent
328a6de86e
commit
71ef0faa2c
@ -216,7 +216,7 @@ AudioOutputSource::Fill(Mutex &mutex)
|
|||||||
{
|
{
|
||||||
if (current_chunk != nullptr && pending_tag == nullptr &&
|
if (current_chunk != nullptr && pending_tag == nullptr &&
|
||||||
pending_data.empty())
|
pending_data.empty())
|
||||||
pipe.Consume(*std::exchange(current_chunk, nullptr));
|
DropCurrentChunk();
|
||||||
|
|
||||||
if (current_chunk != nullptr)
|
if (current_chunk != nullptr)
|
||||||
return true;
|
return true;
|
||||||
@ -247,7 +247,7 @@ AudioOutputSource::ConsumeData(size_t nbytes) noexcept
|
|||||||
pending_data.skip_front(nbytes);
|
pending_data.skip_front(nbytes);
|
||||||
|
|
||||||
if (pending_data.empty())
|
if (pending_data.empty())
|
||||||
pipe.Consume(*std::exchange(current_chunk, nullptr));
|
DropCurrentChunk();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstBuffer<void>
|
ConstBuffer<void>
|
||||||
|
@ -212,6 +212,12 @@ private:
|
|||||||
unsigned *replay_gain_serial_p);
|
unsigned *replay_gain_serial_p);
|
||||||
|
|
||||||
ConstBuffer<void> FilterChunk(const MusicChunk &chunk);
|
ConstBuffer<void> FilterChunk(const MusicChunk &chunk);
|
||||||
|
|
||||||
|
void DropCurrentChunk() noexcept {
|
||||||
|
assert(current_chunk != nullptr);
|
||||||
|
|
||||||
|
pipe.Consume(*std::exchange(current_chunk, nullptr));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user