Read in larger chunks from SD at a time

This helps a little with the stuttering. Some kind of readahead is
probably the ideal tho.
This commit is contained in:
jacqueline
2023-11-06 17:10:52 +11:00
parent c6f2b52331
commit 8309e67a86
+3 -2
View File
@@ -18,7 +18,8 @@
namespace codecs {
[[maybe_unused]] static constexpr char kTag[] = "dec_buf";
static constexpr size_t kBufferSize = 1024 * 8;
static constexpr size_t kBufferSize = 1024 * 128;
static constexpr size_t kReadThreshold = 1024 * 8;
SourceBuffer::SourceBuffer()
: buffer_(reinterpret_cast<std::byte*>(
@@ -34,7 +35,7 @@ SourceBuffer::~SourceBuffer() {
}
auto SourceBuffer::Refill(IStream* src) -> bool {
if (bytes_in_buffer_ == buffer_.size_bytes()) {
if (bytes_in_buffer_ > kReadThreshold) {
return false;
}
bool eof = false;