mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
Fixed negative timestamps occurring with live media (fixes #364)
This commit is contained in:
+1
-5
@@ -42,9 +42,7 @@ export abstract class Muxer {
|
||||
maxTimestampBeforeLastKeyPacket: number | null;
|
||||
}>();
|
||||
|
||||
protected validateAndNormalizeTimestamp(track: OutputTrack, timestampInSeconds: number, isKeyPacket: boolean) {
|
||||
timestampInSeconds += track.source._timestampOffset;
|
||||
|
||||
protected validateTimestamp(track: OutputTrack, timestampInSeconds: number, isKeyPacket: boolean) {
|
||||
if (timestampInSeconds < 0) {
|
||||
throw new Error(`Timestamps must be non-negative (got ${timestampInSeconds}s).`);
|
||||
}
|
||||
@@ -78,7 +76,5 @@ export abstract class Muxer {
|
||||
|
||||
timestampInfo.maxTimestamp = Math.max(timestampInfo.maxTimestamp, timestampInSeconds);
|
||||
}
|
||||
|
||||
return timestampInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user