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.
custom
jacqueline 1 year ago
parent c6f2b52331
commit 8309e67a86
  1. 5
      src/codecs/source_buffer.cpp

@ -18,7 +18,8 @@
namespace codecs { namespace codecs {
[[maybe_unused]] static constexpr char kTag[] = "dec_buf"; [[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() SourceBuffer::SourceBuffer()
: buffer_(reinterpret_cast<std::byte*>( : buffer_(reinterpret_cast<std::byte*>(
@ -34,7 +35,7 @@ SourceBuffer::~SourceBuffer() {
} }
auto SourceBuffer::Refill(IStream* src) -> bool { auto SourceBuffer::Refill(IStream* src) -> bool {
if (bytes_in_buffer_ == buffer_.size_bytes()) { if (bytes_in_buffer_ > kReadThreshold) {
return false; return false;
} }
bool eof = false; bool eof = false;

Loading…
Cancel
Save