mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Attempt acquisition of a placeholder session if format.drmInitData is null
Issue:#4867 PiperOrigin-RevId: 268505056
This commit is contained in:
parent
143d7d6cca
commit
62eb845763
1 changed files with 7 additions and 7 deletions
|
|
@ -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 {
|
||||||
}
|
}
|
||||||
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 {
|
||||||
// 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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue