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
eb0acb41
authored
Jan 07, 2020
by
olly
Committed by
Oliver Woodman
Jan 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix playback for Vivo codecs that output non-16-bit audio
PiperOrigin-RevId: 288468497
parent
d1839f14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
library/core/src/main/java/com/google/android/exoplayer2/audio/MediaCodecAudioRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/audio/MediaCodecAudioRenderer.java
View file @
eb0acb41
...
...
@@ -79,6 +79,11 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
private
static
final
int
MAX_PENDING_STREAM_CHANGE_COUNT
=
10
;
private
static
final
String
TAG
=
"MediaCodecAudioRenderer"
;
/**
* Custom key used to indicate bits per sample by some decoders on Vivo devices. For example
* OMX.vivo.alac.decoder on the Vivo Z1 Pro.
*/
private
static
final
String
VIVO_BITS_PER_SAMPLE_KEY
=
"v-bits-per-sample"
;
private
final
Context
context
;
private
final
EventDispatcher
eventDispatcher
;
...
...
@@ -566,7 +571,11 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
mediaFormat
.
getString
(
MediaFormat
.
KEY_MIME
));
}
else
{
mediaFormat
=
outputMediaFormat
;
encoding
=
getPcmEncoding
(
inputFormat
);
if
(
outputMediaFormat
.
containsKey
(
VIVO_BITS_PER_SAMPLE_KEY
))
{
encoding
=
Util
.
getPcmEncoding
(
outputMediaFormat
.
getInteger
(
VIVO_BITS_PER_SAMPLE_KEY
));
}
else
{
encoding
=
getPcmEncoding
(
inputFormat
);
}
}
int
channelCount
=
mediaFormat
.
getInteger
(
MediaFormat
.
KEY_CHANNEL_COUNT
);
int
sampleRate
=
mediaFormat
.
getInteger
(
MediaFormat
.
KEY_SAMPLE_RATE
);
...
...
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