Skip to content

Commit

Permalink
fix: ogg continued packet parsing, resolves #82
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaz committed Jun 8, 2023
1 parent 1bd891d commit c1ef281
Show file tree
Hide file tree
Showing 26 changed files with 131 additions and 705 deletions.
19 changes: 11 additions & 8 deletions demo/flac-decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3440,22 +3440,25 @@
oggPage[data$1][subarray](offset, (offset += segmentLength))
);

// prepend any existing continued packet data
if (this._continuedPacket[length]) {
oggPageStore[segments][0] = concatBuffers(
this._continuedPacket,
oggPageStore[segments][0]
);

this._continuedPacket = new uint8Array();
}

// save any new continued packet data
if (
headerData[pageSegmentBytes][headerData[pageSegmentBytes][length] - 1] ===
0xff
) {
// continued packet
this._continuedPacket = concatBuffers(
this._continuedPacket,
oggPageStore[segments].pop()
);
} else if (this._continuedPacket[length]) {
oggPageStore[segments][0] = concatBuffers(
this._continuedPacket,
oggPageStore[segments][0]
);

this._continuedPacket = new uint8Array();
}

if (this._codec || this._checkForIdentifier(oggPage)) {
Expand Down
2 changes: 1 addition & 1 deletion demo/flac-decoder.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/flac-decoder.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit c1ef281

Please sign in to comment.