Simplify release event logic in DefaultDrmSession
This is a no-op assuming the class is always used correctly. When release causes referenceCount to reach zero there can be at most one EventDispatcher still connected (which is the one that must be passed to that final release() call), so we can always pass the event directly to the EventDispatcher passed in to release(). PiperOrigin-RevId: 358794004
This commit is contained in:
parent
399e1365d0
commit
8d942dc213
@ -321,14 +321,10 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
mediaDrm.closeSession(sessionId);
|
||||
sessionId = null;
|
||||
}
|
||||
dispatchEvent(DrmSessionEventListener.EventDispatcher::drmSessionReleased);
|
||||
}
|
||||
if (eventDispatcher != null) {
|
||||
if (isOpen()) {
|
||||
// If the session is still open then send the release event only to the provided dispatcher
|
||||
// before removing it.
|
||||
// Acquire and release events are only sent to the provided dispatcher.
|
||||
eventDispatcher.drmSessionReleased();
|
||||
}
|
||||
eventDispatchers.remove(eventDispatcher);
|
||||
}
|
||||
referenceCountListener.onReferenceCountDecremented(this, referenceCount);
|
||||
|
Loading…
x
Reference in New Issue
Block a user