mirror of
https://github.com/samsonjs/media.git
synced 2026-04-01 10:35:48 +00:00
Verify source is not released before updating ad playback state
Updates to the ad playback state are posted on the main handler,
so they may arrive after the source has already been released
(=the internal MediaSource is null). This can cause NPEs.
PiperOrigin-RevId: 555102426
(cherry picked from commit 20d2ce7ce8)
This commit is contained in:
parent
136f0876d5
commit
bab04ebf2c
1 changed files with 3 additions and 1 deletions
|
|
@ -698,7 +698,9 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
|||
|
||||
@MainThread
|
||||
private void invalidateServerSideAdInsertionAdPlaybackState() {
|
||||
if (!adPlaybackState.equals(AdPlaybackState.NONE) && contentTimeline != null) {
|
||||
if (!adPlaybackState.equals(AdPlaybackState.NONE)
|
||||
&& contentTimeline != null
|
||||
&& serverSideAdInsertionMediaSource != null) {
|
||||
Timeline contentTimeline = checkNotNull(this.contentTimeline);
|
||||
ImmutableMap<Object, AdPlaybackState> splitAdPlaybackStates;
|
||||
if (Objects.equals(streamRequest.getFormat(), StreamFormat.DASH)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue