Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b10f4023
authored
Apr 03, 2019
by
bachinger
Committed by
Oliver Woodman
Apr 05, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
handle meta atom as a full box when parsing mp4
Issues: #5698, #5694 PiperOrigin-RevId: 241762106
parent
95f65e52
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
RELEASENOTES.md
library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java
RELEASENOTES.md
View file @
b10f4023
...
...
@@ -96,6 +96,9 @@
*
Use full BCP 47 language tags in
`Format`
.
*
Take byte offset into account when unsynchronizing an id3 frame
(
[
#5673
](
https://github.com/google/ExoPlayer/issues/5673
)
).
*
Handle meta atom as a full box when parsing mp4
(
[
#5698
](
https://github.com/google/ExoPlayer/issues/5698
)
,
[
#5694
](
https://github.com/google/ExoPlayer/issues/5694
)
).
### 2.9.6 ###
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java
View file @
b10f4023
...
...
@@ -309,6 +309,9 @@ public final class Mp4Extractor implements Extractor, SeekMap {
if
(
atomSize
==
atomHeaderBytesRead
)
{
processAtomEnded
(
endPosition
);
}
else
{
if
(
atomType
==
Atom
.
TYPE_meta
)
{
maybeSkipRemainingMetaAtomHeaderBytes
(
input
);
}
// Start reading the first child atom.
enterReadingAtomHeaderState
();
}
...
...
@@ -644,6 +647,32 @@ public final class Mp4Extractor implements Extractor, SeekMap {
}
/**
* Possibly skips the version and flags fields (1+3 byte) of a full meta atom of the {@code
* input}.
*
* <p>Atoms of type {@link Atom#TYPE_meta} are defined to be full atoms which have four additional
* bytes for a version and a flags field (see 4.2 'Object Structure' in ISO/IEC 14496-12:2005).
* QuickTime do not have such a full box structure. Since some of these files are encoded wrongly,
* we can't rely on the file type though. Instead we must check the 8 bytes after the common
* header bytes ourselves.
*/
private
void
maybeSkipRemainingMetaAtomHeaderBytes
(
ExtractorInput
input
)
throws
IOException
,
InterruptedException
{
scratch
.
reset
(
8
);
// Peek the next 8 bytes which can be either
// (iso) [1 byte version + 3 bytes flags][4 byte size of next atom]
// (qt) [4 byte size of next atom ][4 byte hdlr atom type ]
// In case of (iso) we need to skip the next 4 bytes.
input
.
peekFully
(
scratch
.
data
,
0
,
8
);
scratch
.
skipBytes
(
4
);
if
(
scratch
.
readInt
()
==
Atom
.
TYPE_hdlr
)
{
input
.
resetPeekPosition
();
}
else
{
input
.
skipFully
(
4
);
}
}
/**
* For each sample of each track, calculates accumulated size of all samples which need to be read
* before this sample can be used.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment