mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

When we add DRM pre-acquire support to SampleQueue, we'll dispatch twice the number of acquire and release events. This is slightly confusing, since there's the same number of DrmSessionManager#acquireSession() calls. We can mitigate this by only dispatching each acquire and release event to at most one EventDispatcher. This also changes the events fired when playing a stream with both audio and video encrypted with the same keys (even without pre-acquisition). Before: The EventDispatcher would see 2 aquires, 1 key load and 2 release events. After: The EventDispatcher will see 1 acquire, 1 key load and 1 release. PiperOrigin-RevId: 358804502