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=219585084
This commit is contained in:
ishani 2018-10-31 21:47:57 -07:00 committed by Oliver Woodman
parent 609f10b5ec
commit f76b80c3cb
2 changed files with 3 additions and 17 deletions

View File

@ -536,16 +536,6 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
@Override @Override
protected void onDisabled() { protected void onDisabled() {
inputFormat = null; inputFormat = null;
if (drmSession != null || pendingDrmSession != null) {
// TODO: Do something better with this case.
onReset();
} else {
flushOrReleaseCodec();
}
}
@Override
protected void onReset() {
try { try {
releaseCodec(); releaseCodec();
} finally { } finally {
@ -569,14 +559,14 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
protected void releaseCodec() { protected void releaseCodec() {
availableCodecInfos = null; availableCodecInfos = null;
if (codec != null) { if (codec != null) {
codecInfo = null;
codecFormat = null;
resetInputBuffer(); resetInputBuffer();
resetOutputBuffer(); resetOutputBuffer();
resetCodecBuffers(); resetCodecBuffers();
waitingForKeys = false;
codecHotswapDeadlineMs = C.TIME_UNSET; codecHotswapDeadlineMs = C.TIME_UNSET;
waitingForKeys = false;
decodeOnlyPresentationTimestamps.clear(); decodeOnlyPresentationTimestamps.clear();
codecInfo = null;
codecFormat = null;
decoderCounters.decoderReleaseCount++; decoderCounters.decoderReleaseCount++;
try { try {
codec.stop(); codec.stop();

View File

@ -283,12 +283,8 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
@Override @Override
protected void onEnabled(boolean joining) throws ExoPlaybackException { protected void onEnabled(boolean joining) throws ExoPlaybackException {
super.onEnabled(joining); super.onEnabled(joining);
int oldTunnelingAudioSessionId = tunnelingAudioSessionId;
tunnelingAudioSessionId = getConfiguration().tunnelingAudioSessionId; tunnelingAudioSessionId = getConfiguration().tunnelingAudioSessionId;
tunneling = tunnelingAudioSessionId != C.AUDIO_SESSION_ID_UNSET; tunneling = tunnelingAudioSessionId != C.AUDIO_SESSION_ID_UNSET;
if (tunnelingAudioSessionId != oldTunnelingAudioSessionId) {
releaseCodec();
}
eventDispatcher.enabled(decoderCounters); eventDispatcher.enabled(decoderCounters);
frameReleaseTimeHelper.enable(); frameReleaseTimeHelper.enable();
} }