mirror of
https://github.com/samsonjs/media.git
synced 2026-04-21 13:55:47 +00:00
Use a passthrough codec if there is an exoMediaCryptoType
Even without a drmInitData, a format can still has a DRM. PiperOrigin-RevId: 319217188
This commit is contained in:
parent
8bd01a7bec
commit
48f2b44936
1 changed files with 3 additions and 2 deletions
|
|
@ -219,12 +219,13 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
|
|||
}
|
||||
@TunnelingSupport
|
||||
int tunnelingSupport = Util.SDK_INT >= 21 ? TUNNELING_SUPPORTED : TUNNELING_NOT_SUPPORTED;
|
||||
boolean formatHasDrm = format.drmInitData != null || format.exoMediaCryptoType != null;
|
||||
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.
|
||||
if (supportsFormatDrm
|
||||
&& usePassthrough(format)
|
||||
&& (format.drmInitData == null || MediaCodecUtil.getPassthroughDecoderInfo() != null)) {
|
||||
&& (!formatHasDrm || MediaCodecUtil.getPassthroughDecoderInfo() != null)) {
|
||||
return RendererCapabilities.create(FORMAT_HANDLED, ADAPTIVE_NOT_SEAMLESS, tunnelingSupport);
|
||||
}
|
||||
if ((MimeTypes.AUDIO_RAW.equals(format.sampleMimeType) && !audioSink.supportsOutput(format))
|
||||
|
|
|
|||
Loading…
Reference in a new issue