Commit 48f2b449 by krocard Committed by Oliver Woodman

Use a passthrough codec if there is an exoMediaCryptoType

Even without a drmInitData, a format can still has
a DRM.

PiperOrigin-RevId: 319217188
parent 8bd01a7b
...@@ -219,12 +219,13 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media ...@@ -219,12 +219,13 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
} }
@TunnelingSupport @TunnelingSupport
int tunnelingSupport = Util.SDK_INT >= 21 ? TUNNELING_SUPPORTED : TUNNELING_NOT_SUPPORTED; int tunnelingSupport = Util.SDK_INT >= 21 ? TUNNELING_SUPPORTED : TUNNELING_NOT_SUPPORTED;
boolean formatHasDrm = format.drmInitData != null || format.exoMediaCryptoType != null;
boolean supportsFormatDrm = supportsFormatDrm(format); boolean supportsFormatDrm = supportsFormatDrm(format);
// In passthrough mode, if DRM init data is present we need to use a passthrough decoder to // In passthrough mode, if a DRM is present we need to use a passthrough decoder to
// decrypt the content. For passthrough of clear content we don't need a decoder at all. // decrypt the content. For passthrough of clear content we don't need a decoder at all.
if (supportsFormatDrm if (supportsFormatDrm
&& usePassthrough(format) && usePassthrough(format)
&& (format.drmInitData == null || MediaCodecUtil.getPassthroughDecoderInfo() != null)) { && (!formatHasDrm || MediaCodecUtil.getPassthroughDecoderInfo() != null)) {
return RendererCapabilities.create(FORMAT_HANDLED, ADAPTIVE_NOT_SEAMLESS, tunnelingSupport); return RendererCapabilities.create(FORMAT_HANDLED, ADAPTIVE_NOT_SEAMLESS, tunnelingSupport);
} }
if ((MimeTypes.AUDIO_RAW.equals(format.sampleMimeType) && !audioSink.supportsOutput(format)) if ((MimeTypes.AUDIO_RAW.equals(format.sampleMimeType) && !audioSink.supportsOutput(format))
......
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