Commit a7cb6a02 by olly Committed by Ian Baker

Rollback of https://github.com/google/ExoPlayer/commit/1347d572ef9ce79aacd667cfffa7d7468c8408a4

*** Original commit ***

Restore old SampleQueue exoMediaCryptoType behavior

***

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