From ee9110154d2be020e9be913c8cf21e76a9741f27 Mon Sep 17 00:00:00 2001 From: andrewlewis Date: Fri, 3 Dec 2021 18:28:51 +0000 Subject: [PATCH] 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. #minor-release PiperOrigin-RevId: 413967443 --- .../android/exoplayer2/mediacodec/MediaCodecUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java index 8faca221d0..c60836fc2b 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java @@ -512,8 +512,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; }