Fix AVC software decoder sometimes dropping B-frames (fixes #488)

This commit is contained in:
Vanilagy
2026-09-09 16:55:06 +02:00
parent 4b140fe46c
commit f767b6f601
9 changed files with 276 additions and 19 deletions
+13 -1
View File
@@ -55,7 +55,19 @@ export class Bitstream {
}
this.pos = end;
};
}
copyBits(n: number, other: Bitstream) {
let i = 0;
for (i; i < n - 7; i += 8) {
this.writeBits(8, other.readBits(8));
}
const leftover = n - i;
if (leftover > 0) {
this.writeBits(leftover, other.readBits(leftover));
}
}
readAlignedByte() {
if (this.pos % 8 !== 0) {