Apply MTK E-AC3 workaround before API 24

On the Sony Android TV device where this was originally reproducible on
Android L, on Android N there is an E-AC3 decoder listed which handles
the stream correctly. The workaround is harmless anyway but adding the
API version restriction means it will be obvious it can be removed once
we bump our min API to 24 or above in the future.

PiperOrigin-RevId: 413967443
This commit is contained in:
andrewlewis 2021-12-03 18:28:51 +00:00 committed by Ian Baker
parent b9f0592702
commit aae9ebaa7e

View File

@ -514,8 +514,10 @@ public final class MediaCodecUtil {
return false;
}
// MTK E-AC3 decoder doesn't support decoding JOC streams in 2-D. See [Internal: b/69400041].
if (MimeTypes.AUDIO_E_AC3_JOC.equals(mimeType) && "OMX.MTK.AUDIO.DECODER.DSPAC3".equals(name)) {
// MTK AC3 decoder doesn't support decoding JOC streams in 2-D. See [Internal: b/69400041].
if (Util.SDK_INT <= 23
&& MimeTypes.AUDIO_E_AC3_JOC.equals(mimeType)
&& "OMX.MTK.AUDIO.DECODER.DSPAC3".equals(name)) {
return false;
}