Commit 483cf771 by olly Committed by Oliver Woodman

Revert retention of audio decoders

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195752931
parent b7399c75
...@@ -327,10 +327,13 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media ...@@ -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 ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment