Commit 193fd6d1 authored by jan.koester's avatar jan.koester
Browse files

deb

parent 4e29a7cd
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
mediadb (20260424+78) unstable; urgency=medium

  * Fix: guard PrefetchBuffer future .wait() calls with .valid() check.
    Prevents std::future_error "No associated state" crash after .get()
    consumed the future in read(), then drop/seek loops called .wait().

 -- Jan Koester <jan.koester@tuxist.de>  Thu, 24 Apr 2026 00:00:00 +0200

mediadb (20260424+77) unstable; urgency=medium

  * Performance: reduce prefetch block size 256KB→64KB, look-ahead 2MB→256KB,
+3 −3
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ struct PrefetchBuffer {

        // drop blocks entirely before pos (after a seek)
        while (!ring.empty() && ring.front().offset + ring.front().length <= pos) {
            ring.front().fut.wait();
            if (ring.front().fut.valid()) ring.front().fut.wait();
            ring.pop_front();
        }

@@ -168,14 +168,14 @@ struct PrefetchBuffer {
            auto& b = ring.back();
            if (b.offset <= new_pos && new_pos < b.offset + b.length) break;
            if (b.offset > new_pos) {
                b.fut.wait();
                if (b.fut.valid()) b.fut.wait();
                ring.pop_back();
            } else {
                break;
            }
        }
        while (!ring.empty() && ring.front().offset + ring.front().length <= new_pos) {
            ring.front().fut.wait();
            if (ring.front().fut.valid()) ring.front().fut.wait();
            ring.pop_front();
        }
        pos = new_pos;