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
bc731024
authored
Jun 08, 2020
by
andrewlewis
Committed by
Ian Baker
Jun 08, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Suppress repeated logging for invalid MP3 headers
PiperOrigin-RevId: 315243493
parent
680d9558
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/C2Mp3TimestampTracker.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/C2Mp3TimestampTracker.java
View file @
bc731024
...
@@ -34,7 +34,7 @@ import com.google.android.exoplayer2.util.Log;
...
@@ -34,7 +34,7 @@ import com.google.android.exoplayer2.util.Log;
private
long
processedSamples
;
private
long
processedSamples
;
private
long
anchorTimestampUs
;
private
long
anchorTimestampUs
;
private
boolean
audioHeaderInvalid
;
private
boolean
seenInvalidMpegAudioHeader
;
/**
/**
* Resets the timestamp tracker.
* Resets the timestamp tracker.
...
@@ -44,7 +44,7 @@ import com.google.android.exoplayer2.util.Log;
...
@@ -44,7 +44,7 @@ import com.google.android.exoplayer2.util.Log;
public
void
reset
()
{
public
void
reset
()
{
processedSamples
=
0
;
processedSamples
=
0
;
anchorTimestampUs
=
0
;
anchorTimestampUs
=
0
;
audioHeaderInvalid
=
false
;
seenInvalidMpegAudioHeader
=
false
;
}
}
/**
/**
...
@@ -55,7 +55,7 @@ import com.google.android.exoplayer2.util.Log;
...
@@ -55,7 +55,7 @@ import com.google.android.exoplayer2.util.Log;
* @return The expected output presentation time, in microseconds.
* @return The expected output presentation time, in microseconds.
*/
*/
public
long
updateAndGetPresentationTimeUs
(
Format
format
,
DecoderInputBuffer
buffer
)
{
public
long
updateAndGetPresentationTimeUs
(
Format
format
,
DecoderInputBuffer
buffer
)
{
if
(
audioHeaderInvalid
||
buffer
.
data
==
null
)
{
if
(
seenInvalidMpegAudioHeader
||
buffer
.
data
==
null
)
{
return
buffer
.
timeUs
;
return
buffer
.
timeUs
;
}
}
...
@@ -70,6 +70,7 @@ import com.google.android.exoplayer2.util.Log;
...
@@ -70,6 +70,7 @@ import com.google.android.exoplayer2.util.Log;
int
frameCount
=
MpegAudioUtil
.
parseMpegAudioFrameSampleCount
(
sampleHeaderData
);
int
frameCount
=
MpegAudioUtil
.
parseMpegAudioFrameSampleCount
(
sampleHeaderData
);
if
(
frameCount
==
C
.
LENGTH_UNSET
)
{
if
(
frameCount
==
C
.
LENGTH_UNSET
)
{
seenInvalidMpegAudioHeader
=
true
;
Log
.
w
(
TAG
,
"MPEG audio header is invalid."
);
Log
.
w
(
TAG
,
"MPEG audio header is invalid."
);
return
buffer
.
timeUs
;
return
buffer
.
timeUs
;
}
}
...
...
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