Commit 1347d572 by olly Committed by Oliver Woodman

Restore old SampleQueue exoMediaCryptoType behavior

PiperOrigin-RevId: 348818482
parent 3abdec17
...@@ -31,6 +31,7 @@ import com.google.android.exoplayer2.drm.DrmInitData; ...@@ -31,6 +31,7 @@ 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;
...@@ -869,11 +870,11 @@ public class SampleQueue implements TrackOutput { ...@@ -869,11 +870,11 @@ public class SampleQueue implements TrackOutput {
downstreamFormat = newFormat; downstreamFormat = newFormat;
@Nullable DrmInitData newDrmInitData = newFormat.drmInitData; @Nullable DrmInitData newDrmInitData = newFormat.drmInitData;
outputFormatHolder.format = @Nullable
drmSessionManager != null Class<? extends ExoMediaCrypto> exoMediaCryptoType =
? newFormat.copyWithExoMediaCryptoType( (drmSessionManager != null ? drmSessionManager : DrmSessionManager.DUMMY)
drmSessionManager.getExoMediaCryptoType(newFormat)) .getExoMediaCryptoType(newFormat);
: newFormat; outputFormatHolder.format = newFormat.copyWithExoMediaCryptoType(exoMediaCryptoType);
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.
......
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