mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 19:03:46 +02:00
Fix AVC software decoder sometimes dropping B-frames (fixes #488)
This commit is contained in:
+13
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user