*** Original commit ***

Restore old SampleQueue exoMediaCryptoType behavior

***

PiperOrigin-RevId: 350545215
This commit is contained in:
olly 2021-01-07 14:09:40 +00:00 committed by Ian Baker
parent b05fa731d8
commit a7cb6a02e4

View file

@ -31,7 +31,6 @@ import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.drm.DrmSession; import com.google.android.exoplayer2.drm.DrmSession;
import com.google.android.exoplayer2.drm.DrmSessionEventListener; import com.google.android.exoplayer2.drm.DrmSessionEventListener;
import com.google.android.exoplayer2.drm.DrmSessionManager; import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.drm.ExoMediaCrypto;
import com.google.android.exoplayer2.extractor.TrackOutput; import com.google.android.exoplayer2.extractor.TrackOutput;
import com.google.android.exoplayer2.upstream.Allocator; import com.google.android.exoplayer2.upstream.Allocator;
import com.google.android.exoplayer2.upstream.DataReader; import com.google.android.exoplayer2.upstream.DataReader;
@ -870,11 +869,11 @@ public class SampleQueue implements TrackOutput {
downstreamFormat = newFormat; downstreamFormat = newFormat;
@Nullable DrmInitData newDrmInitData = newFormat.drmInitData; @Nullable DrmInitData newDrmInitData = newFormat.drmInitData;
@Nullable outputFormatHolder.format =
Class<? extends ExoMediaCrypto> exoMediaCryptoType = drmSessionManager != null
(drmSessionManager != null ? drmSessionManager : DrmSessionManager.DUMMY) ? newFormat.copyWithExoMediaCryptoType(
.getExoMediaCryptoType(newFormat); drmSessionManager.getExoMediaCryptoType(newFormat))
outputFormatHolder.format = newFormat.copyWithExoMediaCryptoType(exoMediaCryptoType); : newFormat;
outputFormatHolder.drmSession = currentDrmSession; outputFormatHolder.drmSession = currentDrmSession;
if (drmSessionManager == null) { if (drmSessionManager == null) {
// This sample queue is not expected to handle DRM. Nothing to do. // This sample queue is not expected to handle DRM. Nothing to do.