mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
LibCore: Populate the read buffer of Core::Stream::BufferedHelper
Previously, we weren't ever populating the read buffer in read(), which was making the BufferedHelper useless, how silly :^). This introduces a buffer refill when we have run out of buffered samples, restoring FlacLoader performance from the new low of 200% (directly before this commit) to the old level of ~1400%.
This commit is contained in:
parent
8a92573732
commit
7a92842017
1 changed files with 5 additions and 0 deletions
|
@ -522,6 +522,11 @@ public:
|
||||||
// Otherwise, let's try an extra read just in case there's something
|
// Otherwise, let's try an extra read just in case there's something
|
||||||
// in our receive buffer.
|
// in our receive buffer.
|
||||||
auto stream_nread = TRY(stream().read(buffer.slice(buffer_nread)));
|
auto stream_nread = TRY(stream().read(buffer.slice(buffer_nread)));
|
||||||
|
|
||||||
|
// Fill the internal buffer if it has run dry.
|
||||||
|
if (m_buffered_size == 0)
|
||||||
|
TRY(populate_read_buffer());
|
||||||
|
|
||||||
return buffer_nread + stream_nread;
|
return buffer_nread + stream_nread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue