mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Fix mdta handling on I/O error
An I/O error could occur while handling the start of an mdta box, in which case retrying would cause another ContainerAtom to be added. Fix this by skipping the mdta header before updating container atoms. PiperOrigin-RevId: 284000715
This commit is contained in:
parent
32f02107b4
commit
bf495de529
1 changed files with 3 additions and 3 deletions
|
|
@ -304,13 +304,13 @@ public final class Mp4Extractor implements Extractor, SeekMap {
|
|||
|
||||
if (shouldParseContainerAtom(atomType)) {
|
||||
long endPosition = input.getPosition() + atomSize - atomHeaderBytesRead;
|
||||
if (atomSize != atomHeaderBytesRead && atomType == Atom.TYPE_meta) {
|
||||
maybeSkipRemainingMetaAtomHeaderBytes(input);
|
||||
}
|
||||
containerAtoms.push(new ContainerAtom(atomType, endPosition));
|
||||
if (atomSize == atomHeaderBytesRead) {
|
||||
processAtomEnded(endPosition);
|
||||
} else {
|
||||
if (atomType == Atom.TYPE_meta) {
|
||||
maybeSkipRemainingMetaAtomHeaderBytes(input);
|
||||
}
|
||||
// Start reading the first child atom.
|
||||
enterReadingAtomHeaderState();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue