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
97e7fb85
authored
Oct 09, 2016
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ID3: Clean up logging + only add to audio track for MP4
parent
ba1da140
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
14 deletions
demo/src/main/java/com/google/android/exoplayer2/demo/EventLogger.java
library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java
demo/src/main/java/com/google/android/exoplayer2/demo/EventLogger.java
View file @
97e7fb85
...
...
@@ -180,36 +180,38 @@ import java.util.Locale;
@Override
public
void
onMetadata
(
Metadata
metadata
)
{
Log
.
i
(
TAG
,
"metadata ["
);
for
(
int
i
=
0
;
i
<
metadata
.
length
();
i
++)
{
Metadata
.
Entry
entry
=
metadata
.
get
(
i
);
if
(
entry
instanceof
TxxxFrame
)
{
TxxxFrame
txxxFrame
=
(
TxxxFrame
)
entry
;
Log
.
i
(
TAG
,
String
.
format
(
"
ID3 TimedMetadata
%s: description=%s, value=%s"
,
txxxFrame
.
id
,
Log
.
i
(
TAG
,
String
.
format
(
"
%s: description=%s, value=%s"
,
txxxFrame
.
id
,
txxxFrame
.
description
,
txxxFrame
.
value
));
}
else
if
(
entry
instanceof
PrivFrame
)
{
PrivFrame
privFrame
=
(
PrivFrame
)
entry
;
Log
.
i
(
TAG
,
String
.
format
(
"
ID3 TimedMetadata
%s: owner=%s"
,
privFrame
.
id
,
privFrame
.
owner
));
Log
.
i
(
TAG
,
String
.
format
(
"
%s: owner=%s"
,
privFrame
.
id
,
privFrame
.
owner
));
}
else
if
(
entry
instanceof
GeobFrame
)
{
GeobFrame
geobFrame
=
(
GeobFrame
)
entry
;
Log
.
i
(
TAG
,
String
.
format
(
"
ID3 TimedMetadata
%s: mimeType=%s, filename=%s, description=%s"
,
Log
.
i
(
TAG
,
String
.
format
(
"
%s: mimeType=%s, filename=%s, description=%s"
,
geobFrame
.
id
,
geobFrame
.
mimeType
,
geobFrame
.
filename
,
geobFrame
.
description
));
}
else
if
(
entry
instanceof
ApicFrame
)
{
ApicFrame
apicFrame
=
(
ApicFrame
)
entry
;
Log
.
i
(
TAG
,
String
.
format
(
"
ID3 TimedMetadata
%s: mimeType=%s, description=%s"
,
Log
.
i
(
TAG
,
String
.
format
(
"
%s: mimeType=%s, description=%s"
,
apicFrame
.
id
,
apicFrame
.
mimeType
,
apicFrame
.
description
));
}
else
if
(
entry
instanceof
TextInformationFrame
)
{
TextInformationFrame
textInformationFrame
=
(
TextInformationFrame
)
entry
;
Log
.
i
(
TAG
,
String
.
format
(
"
ID3 TimedMetadata
%s: description=%s"
,
textInformationFrame
.
id
,
Log
.
i
(
TAG
,
String
.
format
(
"
%s: description=%s"
,
textInformationFrame
.
id
,
textInformationFrame
.
description
));
}
else
if
(
entry
instanceof
CommentFrame
)
{
CommentFrame
commentFrame
=
(
CommentFrame
)
entry
;
Log
.
i
(
TAG
,
String
.
format
(
"
ID3 TimedMetadata %s: language=%s text
=%s"
,
commentFrame
.
id
,
commentFrame
.
language
,
commentFrame
.
text
));
Log
.
i
(
TAG
,
String
.
format
(
"
%s: language=%s description
=%s"
,
commentFrame
.
id
,
commentFrame
.
language
,
commentFrame
.
description
));
}
else
if
(
entry
instanceof
Id3Frame
)
{
Id3Frame
id3Frame
=
(
Id3Frame
)
entry
;
Log
.
i
(
TAG
,
String
.
format
(
"
ID3 TimedMetadata
%s"
,
id3Frame
.
id
));
Log
.
i
(
TAG
,
String
.
format
(
"
%s"
,
id3Frame
.
id
));
}
}
Log
.
i
(
TAG
,
"]"
);
}
// AudioRendererEventListener
...
...
library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java
View file @
97e7fb85
...
...
@@ -342,12 +342,14 @@ public final class Mp4Extractor implements Extractor, SeekMap {
// Allow ten source samples per output sample, like the platform extractor.
int
maxInputSize
=
trackSampleTable
.
maximumSize
+
3
*
10
;
Format
format
=
track
.
format
.
copyWithMaxInputSize
(
maxInputSize
);
if
(
track
.
type
==
C
.
TRACK_TYPE_AUDIO
&&
gaplessInfoHolder
.
hasGaplessInfo
())
{
format
=
format
.
copyWithGaplessInfo
(
gaplessInfoHolder
.
encoderDelay
,
gaplessInfoHolder
.
encoderPadding
);
}
if
(
metadata
!=
null
)
{
format
=
format
.
copyWithMetadata
(
metadata
);
if
(
track
.
type
==
C
.
TRACK_TYPE_AUDIO
)
{
if
(
gaplessInfoHolder
.
hasGaplessInfo
())
{
format
=
format
.
copyWithGaplessInfo
(
gaplessInfoHolder
.
encoderDelay
,
gaplessInfoHolder
.
encoderPadding
);
}
if
(
metadata
!=
null
)
{
format
=
format
.
copyWithMetadata
(
metadata
);
}
}
mp4Track
.
trackOutput
.
format
(
format
);
...
...
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