chore: address remaining review nits

Add mediabunny (MPL-2.0) to CREDITS.md third-party licenses section.

Add regression test for 4-5 clip compositions under the lowered lazy
threshold — verifies lazy mode activates and no spurious eviction churn
occurs when all clips fit within the promoted cap.
This commit is contained in:
Miguel Ángel
2026-05-19 21:06:22 -04:00
parent 366fcc2a64
commit 20c82980d5
2 changed files with 22 additions and 0 deletions
+6
View File
@@ -22,3 +22,9 @@ Remotion.
Thanks also to the authors and maintainers of the open-source projects
HyperFrames builds on, including Puppeteer, FFmpeg, GSAP, Hono, and the
broader Node.js ecosystem.
## Third-party licenses
- **[mediabunny](https://github.com/nicoch/mediabunny)** — media toolkit used
in the studio for fast metadata extraction from file headers. Licensed under
the [Mozilla Public License 2.0 (MPL-2.0)](https://mozilla.org/MPL/2.0/).
@@ -91,6 +91,22 @@ describe("createMediaPreloadManager", () => {
expect(manager.isLazy()).toBe(true);
});
it("activates lazy mode for 4-5 clip compositions without spurious eviction", () => {
const f = createTestFixture(4);
expect(f.manager.isLazy()).toBe(true);
for (const el of f.elements) el.preload = "metadata";
f.manager.sync(0);
const promoted = f.elements.filter((el) => el.preload === "auto").length;
expect(promoted).toBeGreaterThanOrEqual(2);
expect(promoted).toBeLessThanOrEqual(4);
f.manager.sync(0);
const evicted = f.elements.filter(
(el) =>
el.preload === "metadata" && (el.load as ReturnType<typeof vi.fn>).mock.calls.length > 1,
);
expect(evicted.length).toBe(0);
});
it("sync promotes clips in the lookahead window", () => {
const f = createTestFixture(8);
for (const el of f.elements) el.preload = "metadata";