-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix chain-test1.ogg decoding mismatch
Prior to this commit, the individual streams that make up chain-test1.ogg all had no difference to libvorbis in isolation, but when their concatenation was played back, a decoding mismatch occured for every packet of the second stream. The issue was that the last packet of the first stream should have been shorter than the one lewton outputted. E.g. if you put code like if n == 2022 { dec_data.truncate(1044); } right before the let mut diffs = 0; in the `cmp_output` function, you'd get a match because that'd have leveled out the mismatch. The vorbis spec says that the absgp of each page marks the last sample inside the last packet that ends it. It also says that if the absgp of the last page of the entire stream is before the actually decoded length of the last packet, truncation is neccessary. This truncation was the cause for the mismatch as vorbis implemented and we didn't. This commit implements the truncation and thus fixes the mismatch for chain-test1.ogg. Addresses parts of #26.
- Loading branch information
Showing
2 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters