Skip to content
  • Jan Schmidt's avatar
    baseparse: Fix upstream read caching · 177d0fa1
    Jan Schmidt authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
    When running in pull mode (for e.g. mp3 reading),
    baseparse currently reads 64KB from upstream, then mp3parse
    consumes typically around 417/418 bytes of it. Then
    on the next loop, it will read a full fresh 64KB again,
    which is a big waste.
    
    Fix the read loop to use the available cache buffer first
    before going for more data, until the cache drops to < 1KB.
    
    Fixes #518
    177d0fa1