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
1201466b
authored
Nov 25, 2020
by
olly
Committed by
Andrew Lewis
Nov 27, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix NPE in onInputFormatChanged
PiperOrigin-RevId: 344243929
parent
3aa17bfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java
View file @
1201466b
...
@@ -1408,7 +1408,12 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -1408,7 +1408,12 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
// We have an existing codec that we may need to reconfigure, re-initialize, or release to
// We have an existing codec that we may need to reconfigure, re-initialize, or release to
// switch to bypass. If the existing codec instance is kept then its operating rate and DRM
// switch to bypass. If the existing codec instance is kept then its operating rate and DRM
// session may need to be updated.
// session may need to be updated.
MediaCodecAdapter
oldCodec
=
codec
;
// Copy the current codec and codecInfo to local variables so they remain accessible if the
// member variables are updated during the logic below.
MediaCodecAdapter
codec
=
this
.
codec
;
MediaCodecInfo
codecInfo
=
this
.
codecInfo
;
Format
oldFormat
=
codecInputFormat
;
Format
oldFormat
=
codecInputFormat
;
if
(
drmNeedsCodecReinitialization
(
codecInfo
,
newFormat
,
codecDrmSession
,
sourceDrmSession
))
{
if
(
drmNeedsCodecReinitialization
(
codecInfo
,
newFormat
,
codecDrmSession
,
sourceDrmSession
))
{
drainAndReinitializeCodec
();
drainAndReinitializeCodec
();
...
@@ -1474,7 +1479,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
...
@@ -1474,7 +1479,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
}
}
if
(
evaluation
.
result
!=
REUSE_RESULT_NO
if
(
evaluation
.
result
!=
REUSE_RESULT_NO
&&
(
codec
!=
oldC
odec
||
codecDrainAction
==
DRAIN_ACTION_REINITIALIZE
))
{
&&
(
this
.
codec
!=
c
odec
||
codecDrainAction
==
DRAIN_ACTION_REINITIALIZE
))
{
// Initial evaluation indicated reuse was possible, but codec re-initialization was triggered.
// Initial evaluation indicated reuse was possible, but codec re-initialization was triggered.
// The reasons are indicated by overridingDiscardReasons.
// The reasons are indicated by overridingDiscardReasons.
return
new
DecoderReuseEvaluation
(
return
new
DecoderReuseEvaluation
(
...
...
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