Commit 62eb8457 by aquilescanta Committed by Oliver Woodman

Attempt acquisition of a placeholder session if format.drmInitData is null

Issue:#4867
PiperOrigin-RevId: 268505056
parent 143d7d6c
...@@ -156,6 +156,7 @@ public final class DecryptableSampleQueueReader { ...@@ -156,6 +156,7 @@ public final class DecryptableSampleQueueReader {
*/ */
private void onFormat(Format format, FormatHolder outputFormatHolder) { private void onFormat(Format format, FormatHolder outputFormatHolder) {
outputFormatHolder.format = format; outputFormatHolder.format = format;
boolean isFirstFormat = currentFormat == null;
DrmInitData oldDrmInitData = currentFormat != null ? currentFormat.drmInitData : null; DrmInitData oldDrmInitData = currentFormat != null ? currentFormat.drmInitData : null;
currentFormat = format; currentFormat = format;
if (sessionManager == DrmSessionManager.DUMMY) { if (sessionManager == DrmSessionManager.DUMMY) {
...@@ -167,7 +168,7 @@ public final class DecryptableSampleQueueReader { ...@@ -167,7 +168,7 @@ public final class DecryptableSampleQueueReader {
} }
outputFormatHolder.includesDrmSession = true; outputFormatHolder.includesDrmSession = true;
outputFormatHolder.drmSession = currentSession; outputFormatHolder.drmSession = currentSession;
if (Util.areEqual(oldDrmInitData, format.drmInitData)) { if (!isFirstFormat && Util.areEqual(oldDrmInitData, format.drmInitData)) {
// Nothing to do. // Nothing to do.
return; return;
} }
...@@ -175,12 +176,11 @@ public final class DecryptableSampleQueueReader { ...@@ -175,12 +176,11 @@ public final class DecryptableSampleQueueReader {
// can be used for both DrmInitData. // can be used for both DrmInitData.
DrmSession<?> previousSession = currentSession; DrmSession<?> previousSession = currentSession;
DrmInitData drmInitData = currentFormat.drmInitData; DrmInitData drmInitData = currentFormat.drmInitData;
if (drmInitData != null) { Looper playbackLooper = Assertions.checkNotNull(Looper.myLooper());
currentSession = currentSession =
sessionManager.acquireSession(Assertions.checkNotNull(Looper.myLooper()), drmInitData); drmInitData != null
} else { ? sessionManager.acquireSession(playbackLooper, drmInitData)
currentSession = null; : sessionManager.acquirePlaceholderSession(playbackLooper);
}
outputFormatHolder.drmSession = currentSession; outputFormatHolder.drmSession = currentSession;
if (previousSession != null) { if (previousSession != null) {
......
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