mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 19:03:46 +02:00
Validate nextKey behavior for audio tracks
This commit is contained in:
@@ -996,6 +996,18 @@ test('AudioSampleCursor', async () => {
|
||||
// One pump was used for all the above commands, even tho they all seek to different key packets
|
||||
expect(cursor.debugInfo.pumpsStarted).toBe(4);
|
||||
|
||||
await cursor.seekToFirst();
|
||||
const nextSample = (await cursor.nextKey())!; // nextKey acts like next for audio tracks
|
||||
const nextNextSample = (await cursor.nextKey())!;
|
||||
expect(nextSample.timestamp).toBeCloseTo(firstSample.timestamp + firstSample.duration);
|
||||
expect(nextNextSample.timestamp).toBeCloseTo(nextSample.timestamp + firstSample.duration);
|
||||
|
||||
await cursor.seekToFirst();
|
||||
const actualNextSample = (await cursor.next())!;
|
||||
expect(nextSample.timestamp).toBe(actualNextSample.timestamp);
|
||||
|
||||
expect(cursor.debugInfo.pumpsStarted).toBe(6);
|
||||
|
||||
await cursor.close();
|
||||
|
||||
expect(AudioSample._openSampleCount).toBe(0);
|
||||
|
||||
Reference in New Issue
Block a user