mirror of
https://github.com/samsonjs/media.git
synced 2026-04-01 10:35:48 +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
1e609e245b
commit
4f363b1492
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