mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 19:03:46 +02:00
Add fix to ensure VideoFrames are output in timestamp order, fix atTimestamps iterator logic & leaks
This commit is contained in:
+2
-26
@@ -10,6 +10,7 @@ export class EncodedVideoSample {
|
||||
public readonly type: SampleType,
|
||||
public readonly timestamp: number,
|
||||
public readonly duration: number,
|
||||
public readonly sequenceNumber = -1,
|
||||
public readonly byteLength = data.byteLength,
|
||||
) {
|
||||
if (!(data instanceof Uint8Array)) {
|
||||
@@ -58,19 +59,6 @@ export class EncodedVideoSample {
|
||||
});
|
||||
}
|
||||
|
||||
is(otherSample: EncodedVideoSample) {
|
||||
if (!(otherSample instanceof EncodedVideoSample)) {
|
||||
throw new TypeError('otherSample must be an EncodedVideoSample.');
|
||||
}
|
||||
|
||||
return (
|
||||
this.type === otherSample.type
|
||||
&& this.timestamp === otherSample.timestamp
|
||||
&& this.duration === otherSample.duration
|
||||
&& this.byteLength === otherSample.byteLength
|
||||
);
|
||||
}
|
||||
|
||||
clone(options?: {
|
||||
timestamp?: number;
|
||||
duration?: number;
|
||||
@@ -118,6 +106,7 @@ export class EncodedAudioSample {
|
||||
public readonly type: SampleType,
|
||||
public readonly timestamp: number,
|
||||
public readonly duration: number,
|
||||
public readonly sequenceNumber = -1,
|
||||
public readonly byteLength = data.byteLength,
|
||||
) {
|
||||
if (!(data instanceof Uint8Array)) {
|
||||
@@ -166,19 +155,6 @@ export class EncodedAudioSample {
|
||||
});
|
||||
}
|
||||
|
||||
is(otherSample: EncodedAudioSample) {
|
||||
if (!(otherSample instanceof EncodedAudioSample)) {
|
||||
throw new TypeError('otherSample must be an EncodedAudioSample.');
|
||||
}
|
||||
|
||||
return (
|
||||
this.type === otherSample.type
|
||||
&& this.timestamp === otherSample.timestamp
|
||||
&& this.duration === otherSample.duration
|
||||
&& this.byteLength === otherSample.byteLength
|
||||
);
|
||||
}
|
||||
|
||||
clone(options?: {
|
||||
timestamp?: number;
|
||||
duration?: number;
|
||||
|
||||
Reference in New Issue
Block a user