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
679fa8de
authored
Aug 19, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Only use passthrough for passthrough MIME types.
parent
e770e5c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
library/src/main/java/com/google/android/exoplayer/MediaCodecAudioTrackRenderer.java
library/src/main/java/com/google/android/exoplayer/MediaCodecAudioTrackRenderer.java
View file @
679fa8de
...
...
@@ -160,8 +160,8 @@ public class MediaCodecAudioTrackRenderer extends MediaCodecTrackRenderer implem
}
/**
* Returns whether encoded audio passthrough
may be used for playing back the input format. This
* implementation returns true if the {@link AudioTrack}'s audio capabilities indicate that
* Returns whether encoded audio passthrough
should be used for playing back the input format.
*
This
implementation returns true if the {@link AudioTrack}'s audio capabilities indicate that
* passthrough is supported.
*
* @param mimeType The type of input media.
...
...
@@ -174,9 +174,9 @@ public class MediaCodecAudioTrackRenderer extends MediaCodecTrackRenderer implem
@Override
protected
void
configureCodec
(
MediaCodec
codec
,
String
codecName
,
android
.
media
.
MediaFormat
format
,
android
.
media
.
MediaCrypto
crypto
)
{
if
(
RAW_DECODER_NAME
.
equals
(
codecName
))
{
String
mimeType
=
format
.
getString
(
android
.
media
.
MediaFormat
.
KEY_MIME
);
if
(
RAW_DECODER_NAME
.
equals
(
codecName
)
&&
!
MimeTypes
.
AUDIO_RAW
.
equals
(
mimeType
))
{
// Override the MIME type used to configure the codec if we are using a passthrough decoder.
String
mimeType
=
format
.
getString
(
android
.
media
.
MediaFormat
.
KEY_MIME
);
format
.
setString
(
android
.
media
.
MediaFormat
.
KEY_MIME
,
MimeTypes
.
AUDIO_RAW
);
codec
.
configure
(
format
,
null
,
crypto
,
0
);
format
.
setString
(
android
.
media
.
MediaFormat
.
KEY_MIME
,
mimeType
);
...
...
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