mirror of
https://github.com/samsonjs/media.git
synced 2026-04-26 14:57:47 +00:00
Fix a bug where ID3 data was read as sample data.
When reading unknown duration files with CBR seeking, the Mp3Extractor could try to read sample data from 0. This happened because synchronization did not skip over the ID3 data when it immediately found valid frames. When the invalid sample data is read, the extractor tries to resynchronize from the next byte (at offset 1), and this fails because the ID3 data at the start of the file is longer than the synchronization search distance. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117224270
This commit is contained in:
parent
d9d6b8540d
commit
26ad44248a
1 changed files with 3 additions and 0 deletions
|
|
@ -204,6 +204,9 @@ public final class Mp3Extractor implements Extractor {
|
|||
if (input.getPosition() == 0) {
|
||||
gaplessInfo = Id3Util.parseId3(input);
|
||||
peekedId3Bytes = (int) input.getPeekPosition();
|
||||
if (!sniffing) {
|
||||
input.skipFully(peekedId3Bytes);
|
||||
}
|
||||
}
|
||||
while (true) {
|
||||
if (sniffing && searched == MAX_SNIFF_BYTES) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue