Skip to content

Commit

Permalink
Automated g4 rollback of changelist 219585084.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

Rolling forward again as [] should fix issue that prompted the rollback

*** Original change description ***

Automated g4 rollback of changelist 219130576.

*** Original change description ***

Re-enable codec re-use

Issue: #2826

***

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220124362
  • Loading branch information
ojw28 committed Nov 6, 2018
1 parent 0afd9c1 commit 8844694
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,16 @@ public final void setOperatingRate(float operatingRate) throws ExoPlaybackExcept
@Override
protected void onDisabled() {
inputFormat = null;
if (drmSession != null || pendingDrmSession != null) {
// TODO: Do something better with this case.
onReset();
} else {
flushOrReleaseCodec();
}
}

@Override
protected void onReset() {
try {
releaseCodec();
} finally {
Expand All @@ -575,14 +585,14 @@ protected void onDisabled() {
protected void releaseCodec() {
availableCodecInfos = null;
if (codec != null) {
codecInfo = null;
codecFormat = null;
resetInputBuffer();
resetOutputBuffer();
resetCodecBuffers();
codecHotswapDeadlineMs = C.TIME_UNSET;
waitingForKeys = false;
codecHotswapDeadlineMs = C.TIME_UNSET;
decodeOnlyPresentationTimestamps.clear();
codecInfo = null;
codecFormat = null;
decoderCounters.decoderReleaseCount++;
try {
codec.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,12 @@ protected int supportsFormat(MediaCodecSelector mediaCodecSelector,
@Override
protected void onEnabled(boolean joining) throws ExoPlaybackException {
super.onEnabled(joining);
int oldTunnelingAudioSessionId = tunnelingAudioSessionId;
tunnelingAudioSessionId = getConfiguration().tunnelingAudioSessionId;
tunneling = tunnelingAudioSessionId != C.AUDIO_SESSION_ID_UNSET;
if (tunnelingAudioSessionId != oldTunnelingAudioSessionId) {
releaseCodec();
}
eventDispatcher.enabled(decoderCounters);
frameReleaseTimeHelper.enable();
}
Expand Down

0 comments on commit 8844694

Please sign in to comment.