Fixed negative timestamps occurring with live media (fixes #364)

This commit is contained in:
Vanilagy
2026-05-07 11:11:37 +02:00
parent daf42181c9
commit fff09411e6
11 changed files with 40 additions and 53 deletions
+1 -5
View File
@@ -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;
}
}