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
7e635d95
authored
Nov 30, 2020
by
samrobinson
Committed by
Oliver Woodman
Dec 03, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Set Format gapless info separately to Metadata in Extractors.
PiperOrigin-RevId: 344838400
parent
e6046a5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/MetadataUtil.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/MetadataUtil.java
View file @
7e635d95
...
...
@@ -292,17 +292,11 @@ import java.util.List;
int
trackType
,
@Nullable
Metadata
udtaMetadata
,
@Nullable
Metadata
mdtaMetadata
,
GaplessInfoHolder
gaplessInfoHolder
,
Format
.
Builder
formatBuilder
,
Metadata
.
Entry
...
additionalEntries
)
{
Metadata
formatMetadata
=
new
Metadata
();
if
(
trackType
==
C
.
TRACK_TYPE_AUDIO
)
{
if
(
gaplessInfoHolder
.
hasGaplessInfo
())
{
formatBuilder
.
setEncoderDelay
(
gaplessInfoHolder
.
encoderDelay
)
.
setEncoderPadding
(
gaplessInfoHolder
.
encoderPadding
);
}
// We assume all udta metadata is associated with the audio track.
if
(
udtaMetadata
!=
null
)
{
formatMetadata
=
udtaMetadata
;
...
...
@@ -333,6 +327,18 @@ import java.util.List;
}
/**
* Updates a {@link Format.Builder} to include audio gapless information from the provided source.
*/
public
static
void
setFormatGaplessInfo
(
int
trackType
,
GaplessInfoHolder
gaplessInfoHolder
,
Format
.
Builder
formatBuilder
)
{
if
(
trackType
==
C
.
TRACK_TYPE_AUDIO
&&
gaplessInfoHolder
.
hasGaplessInfo
())
{
formatBuilder
.
setEncoderDelay
(
gaplessInfoHolder
.
encoderDelay
)
.
setEncoderPadding
(
gaplessInfoHolder
.
encoderPadding
);
}
}
/**
* Parses a single userdata ilst element from a {@link ParsableByteArray}. The element is read
* starting from the current position of the {@link ParsableByteArray}, and the position is
* advanced by the size of the element. The position is advanced even if the element's type is
...
...
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java
View file @
7e635d95
...
...
@@ -514,11 +514,11 @@ public final class Mp4Extractor implements Extractor, SeekMap {
formatBuilder
.
setFrameRate
(
frameRate
);
}
MetadataUtil
.
setFormatGaplessInfo
(
track
.
type
,
gaplessInfoHolder
,
formatBuilder
);
MetadataUtil
.
setFormatMetadata
(
track
.
type
,
udtaMetadata
,
mdtaMetadata
,
gaplessInfoHolder
,
formatBuilder
,
/* additionalEntries...= */
slowMotionMetadataEntries
.
toArray
(
new
Metadata
.
Entry
[
0
]));
mp4Track
.
trackOutput
.
format
(
formatBuilder
.
build
());
...
...
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