Skip to content

Commit 20c8298

Browse files
committed
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.
1 parent 366fcc2 commit 20c8298

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

CREDITS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ Remotion.
2222
Thanks also to the authors and maintainers of the open-source projects
2323
HyperFrames builds on, including Puppeteer, FFmpeg, GSAP, Hono, and the
2424
broader Node.js ecosystem.
25+
26+
## Third-party licenses
27+
28+
- **[mediabunny](https://github.com/nicoch/mediabunny)** — media toolkit used
29+
in the studio for fast metadata extraction from file headers. Licensed under
30+
the [Mozilla Public License 2.0 (MPL-2.0)](https://mozilla.org/MPL/2.0/).

packages/core/src/runtime/mediaPreloader.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,22 @@ describe("createMediaPreloadManager", () => {
9191
expect(manager.isLazy()).toBe(true);
9292
});
9393

94+
it("activates lazy mode for 4-5 clip compositions without spurious eviction", () => {
95+
const f = createTestFixture(4);
96+
expect(f.manager.isLazy()).toBe(true);
97+
for (const el of f.elements) el.preload = "metadata";
98+
f.manager.sync(0);
99+
const promoted = f.elements.filter((el) => el.preload === "auto").length;
100+
expect(promoted).toBeGreaterThanOrEqual(2);
101+
expect(promoted).toBeLessThanOrEqual(4);
102+
f.manager.sync(0);
103+
const evicted = f.elements.filter(
104+
(el) =>
105+
el.preload === "metadata" && (el.load as ReturnType<typeof vi.fn>).mock.calls.length > 1,
106+
);
107+
expect(evicted.length).toBe(0);
108+
});
109+
94110
it("sync promotes clips in the lookahead window", () => {
95111
const f = createTestFixture(8);
96112
for (const el of f.elements) el.preload = "metadata";

0 commit comments

Comments
 (0)