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
f1ded9c3
authored
Feb 04, 2019
by
olly
Committed by
Oliver Woodman
Feb 04, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Wider fix for OMX.SEC.mp3.dec issue
Issue: #4519 PiperOrigin-RevId: 232299233
parent
5e311fc8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
29 deletions
RELEASENOTES.md
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java
RELEASENOTES.md
View file @
f1ded9c3
...
@@ -56,6 +56,8 @@
...
@@ -56,6 +56,8 @@
*
IMA extension: Upgrade IMA dependency to 3.10.6.
*
IMA extension: Upgrade IMA dependency to 3.10.6.
*
Cronet extension: Upgrade Cronet dependency to 71.3578.98.
*
Cronet extension: Upgrade Cronet dependency to 71.3578.98.
*
OkHttp extension: Upgrade OkHttp dependency to 3.12.1.
*
OkHttp extension: Upgrade OkHttp dependency to 3.12.1.
*
MP3: Wider fix for issue where streams would play twice on some Samsung
devices (
[
#4519
](
https://github.com/google/ExoPlayer/issues/4519
)
).
### 2.9.4 ###
### 2.9.4 ###
...
...
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java
View file @
f1ded9c3
...
@@ -58,8 +58,6 @@ public final class MediaCodecUtil {
...
@@ -58,8 +58,6 @@ public final class MediaCodecUtil {
private
static
final
String
TAG
=
"MediaCodecUtil"
;
private
static
final
String
TAG
=
"MediaCodecUtil"
;
private
static
final
Pattern
PROFILE_PATTERN
=
Pattern
.
compile
(
"^\\D?(\\d+)$"
);
private
static
final
Pattern
PROFILE_PATTERN
=
Pattern
.
compile
(
"^\\D?(\\d+)$"
);
private
static
final
RawAudioCodecComparator
RAW_AUDIO_CODEC_COMPARATOR
=
new
RawAudioCodecComparator
();
private
static
final
HashMap
<
CodecKey
,
List
<
MediaCodecInfo
>>
decoderInfosCache
=
new
HashMap
<>();
private
static
final
HashMap
<
CodecKey
,
List
<
MediaCodecInfo
>>
decoderInfosCache
=
new
HashMap
<>();
...
@@ -311,32 +309,6 @@ public final class MediaCodecUtil {
...
@@ -311,32 +309,6 @@ public final class MediaCodecUtil {
return
false
;
return
false
;
}
}
// Work around https://github.com/google/ExoPlayer/issues/398.
if
(
Util
.
SDK_INT
<
18
&&
"OMX.SEC.MP3.Decoder"
.
equals
(
name
))
{
return
false
;
}
// Work around https://github.com/google/ExoPlayer/issues/4519.
if
(
"OMX.SEC.mp3.dec"
.
equals
(
name
)
&&
(
Util
.
MODEL
.
startsWith
(
"GT-I9152"
)
||
Util
.
MODEL
.
startsWith
(
"GT-I9515"
)
||
Util
.
MODEL
.
startsWith
(
"GT-P5220"
)
||
Util
.
MODEL
.
startsWith
(
"GT-S7580"
)
||
Util
.
MODEL
.
startsWith
(
"SM-G350"
)
||
Util
.
MODEL
.
startsWith
(
"SM-G386"
)
||
Util
.
MODEL
.
startsWith
(
"SM-T231"
)
||
Util
.
MODEL
.
startsWith
(
"SM-T530"
)
||
Util
.
MODEL
.
startsWith
(
"SCH-I535"
)
||
Util
.
MODEL
.
startsWith
(
"SPH-L710"
)))
{
return
false
;
}
if
(
"OMX.brcm.audio.mp3.decoder"
.
equals
(
name
)
&&
(
Util
.
MODEL
.
startsWith
(
"GT-I9152"
)
||
Util
.
MODEL
.
startsWith
(
"GT-S7580"
)
||
Util
.
MODEL
.
startsWith
(
"SM-G350"
)))
{
return
false
;
}
// Work around https://github.com/google/ExoPlayer/issues/1528 and
// Work around https://github.com/google/ExoPlayer/issues/1528 and
// https://github.com/google/ExoPlayer/issues/3171.
// https://github.com/google/ExoPlayer/issues/3171.
if
(
Util
.
SDK_INT
<
18
&&
"OMX.MTK.AUDIO.DECODER.AAC"
.
equals
(
name
)
if
(
Util
.
SDK_INT
<
18
&&
"OMX.MTK.AUDIO.DECODER.AAC"
.
equals
(
name
)
...
@@ -423,7 +395,18 @@ public final class MediaCodecUtil {
...
@@ -423,7 +395,18 @@ public final class MediaCodecUtil {
*/
*/
private
static
void
applyWorkarounds
(
String
mimeType
,
List
<
MediaCodecInfo
>
decoderInfos
)
{
private
static
void
applyWorkarounds
(
String
mimeType
,
List
<
MediaCodecInfo
>
decoderInfos
)
{
if
(
MimeTypes
.
AUDIO_RAW
.
equals
(
mimeType
))
{
if
(
MimeTypes
.
AUDIO_RAW
.
equals
(
mimeType
))
{
Collections
.
sort
(
decoderInfos
,
RAW_AUDIO_CODEC_COMPARATOR
);
Collections
.
sort
(
decoderInfos
,
new
RawAudioCodecComparator
());
}
else
if
(
Util
.
SDK_INT
<
21
&&
decoderInfos
.
size
()
>
1
)
{
String
firstCodecName
=
decoderInfos
.
get
(
0
).
name
;
if
(
"OMX.SEC.mp3.dec"
.
equals
(
firstCodecName
)
||
"OMX.SEC.MP3.Decoder"
.
equals
(
firstCodecName
)
||
"OMX.brcm.audio.mp3.decoder"
.
equals
(
firstCodecName
))
{
// Prefer OMX.google codecs over OMX.SEC.mp3.dec, OMX.SEC.MP3.Decoder and
// OMX.brcm.audio.mp3.decoder on older devices. See:
// https://github.com/google/ExoPlayer/issues/398 and
// https://github.com/google/ExoPlayer/issues/4519.
Collections
.
sort
(
decoderInfos
,
new
PreferOmxGoogleCodecComparator
());
}
}
}
}
}
...
@@ -729,6 +712,18 @@ public final class MediaCodecUtil {
...
@@ -729,6 +712,18 @@ public final class MediaCodecUtil {
}
}
}
}
/** Comparator for preferring OMX.google media codecs. */
private
static
final
class
PreferOmxGoogleCodecComparator
implements
Comparator
<
MediaCodecInfo
>
{
@Override
public
int
compare
(
MediaCodecInfo
a
,
MediaCodecInfo
b
)
{
return
scoreMediaCodecInfo
(
a
)
-
scoreMediaCodecInfo
(
b
);
}
private
static
int
scoreMediaCodecInfo
(
MediaCodecInfo
mediaCodecInfo
)
{
return
mediaCodecInfo
.
name
.
startsWith
(
"OMX.google"
)
?
-
1
:
0
;
}
}
static
{
static
{
AVC_PROFILE_NUMBER_TO_CONST
=
new
SparseIntArray
();
AVC_PROFILE_NUMBER_TO_CONST
=
new
SparseIntArray
();
AVC_PROFILE_NUMBER_TO_CONST
.
put
(
66
,
CodecProfileLevel
.
AVCProfileBaseline
);
AVC_PROFILE_NUMBER_TO_CONST
.
put
(
66
,
CodecProfileLevel
.
AVCProfileBaseline
);
...
...
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