mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-30 12:23:52 +02:00
Update thumbnail generation example to use cursors
This commit is contained in:
+1
-1
@@ -930,7 +930,6 @@ export abstract class SampleCursor<
|
||||
this._lastPendingRequest = pendingRequest;
|
||||
|
||||
this._pumpGate.open();
|
||||
|
||||
deferred.execute(); // Waiting for the return would be too long
|
||||
|
||||
return res.set(await request.promise);
|
||||
@@ -987,6 +986,7 @@ export abstract class SampleCursor<
|
||||
}
|
||||
this._lastPendingRequest = pendingRequest;
|
||||
|
||||
this._pumpGate.open();
|
||||
lock.release(); // Waiting for the return would be too long
|
||||
|
||||
return res.set(await request.promise);
|
||||
|
||||
@@ -2368,7 +2368,10 @@ abstract class IsobmffTrackBacking implements InputTrackBacking {
|
||||
}
|
||||
|
||||
async getFirstTimestamp() {
|
||||
const firstPacket = await this.getFirstPacket({ metadataOnly: true });
|
||||
const result = new ResultValue<EncodedPacket | null>();
|
||||
await this.getFirstPacket(result, { metadataOnly: true });
|
||||
|
||||
const firstPacket = result.value;
|
||||
return firstPacket?.timestamp ?? 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user