Multiple miscellaneous fixes

This commit is contained in:
Vanilagy
2025-02-18 22:13:21 +01:00
parent 3848a59ec3
commit 7988b6c2f8
9 changed files with 50 additions and 39 deletions
+5
View File
@@ -26,6 +26,7 @@ import {
binarySearchLessOrEqual,
COLOR_PRIMARIES_MAP_INVERSE,
findLastIndex,
isIso639Dash2LanguageCode,
last,
MATRIX_COEFFICIENTS_MAP_INVERSE,
Rotation,
@@ -749,6 +750,10 @@ export class MatroskaDemuxer extends Demuxer {
if (!this.currentTrack) break;
this.currentTrack.languageCode = reader.readString(size);
if (!isIso639Dash2LanguageCode(this.currentTrack.languageCode)) {
this.currentTrack.languageCode = UNDETERMINED_LANGUAGE;
}
}; break;
case EBMLId.Video: {
+2 -2
View File
@@ -687,8 +687,8 @@ export class MatroskaMuxer extends Muxer {
}
const relativeTimestamp = msTimestamp - this.currentClusterStartMsTimestamp!;
if (relativeTimestamp < 0) {
// The chunk lies outside of the current cluster
if (relativeTimestamp < -(2 ** 15)) {
// The block lies too far in the past, it's not representable within this cluster
return;
}