Revert retention of audio decoders

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195752931
This commit is contained in:
olly 2018-05-07 17:59:26 -07:00 committed by Oliver Woodman
parent b7399c7559
commit 483cf77120

View File

@ -327,10 +327,13 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
@Override @Override
protected @KeepCodecResult int canKeepCodec( protected @KeepCodecResult int canKeepCodec(
MediaCodec codec, MediaCodecInfo codecInfo, Format oldFormat, Format newFormat) { MediaCodec codec, MediaCodecInfo codecInfo, Format oldFormat, Format newFormat) {
return getCodecMaxInputSize(codecInfo, newFormat) <= codecMaxInputSize return KEEP_CODEC_RESULT_NO;
&& areAdaptationCompatible(oldFormat, newFormat) // TODO: Determine when codecs can be safely kept. When doing so, also uncomment the commented
? KEEP_CODEC_RESULT_YES_WITHOUT_RECONFIGURATION // out code in getCodecMaxInputSize.
: KEEP_CODEC_RESULT_NO; // return getCodecMaxInputSize(codecInfo, newFormat) <= codecMaxInputSize
// && areAdaptationCompatible(oldFormat, newFormat)
// ? KEEP_CODEC_RESULT_YES_WITHOUT_RECONFIGURATION
// : KEEP_CODEC_RESULT_NO;
} }
@Override @Override
@ -571,16 +574,16 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
protected int getCodecMaxInputSize( protected int getCodecMaxInputSize(
MediaCodecInfo codecInfo, Format format, Format[] streamFormats) { MediaCodecInfo codecInfo, Format format, Format[] streamFormats) {
int maxInputSize = getCodecMaxInputSize(codecInfo, format); int maxInputSize = getCodecMaxInputSize(codecInfo, format);
if (streamFormats.length == 1) { // if (streamFormats.length == 1) {
// The single entry in streamFormats must correspond to the format for which the codec is // // The single entry in streamFormats must correspond to the format for which the codec is
// being configured. // // being configured.
return maxInputSize; // return maxInputSize;
} // }
for (Format streamFormat : streamFormats) { // for (Format streamFormat : streamFormats) {
if (areAdaptationCompatible(format, streamFormat)) { // if (areAdaptationCompatible(format, streamFormat)) {
maxInputSize = Math.max(maxInputSize, getCodecMaxInputSize(codecInfo, streamFormat)); // maxInputSize = Math.max(maxInputSize, getCodecMaxInputSize(codecInfo, streamFormat));
} // }
} // }
return maxInputSize; return maxInputSize;
} }