diff --git a/RELEASENOTES.md b/RELEASENOTES.md index acb85e4a18..96733f848c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -33,6 +33,7 @@ * Fix bug where a multi-period DASH live stream that is not the first item in a playlist can throw an exception ([#571](https://github.com/androidx/media/issues/571)). + * Release StreamManager before calling `AdsLoader.destroy()` * Session: * Set the notifications foreground service behavior to `FOREGROUND_SERVICE_IMMEDIATE` in `DefaultMediaNotificationProvider` diff --git a/libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.java b/libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.java index 33623a3b6c..e95213b6ca 100644 --- a/libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.java +++ b/libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.java @@ -453,9 +453,9 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou public State release() { for (MediaSourceResourceHolder resourceHolder : mediaSourceResources.values()) { resourceHolder.streamPlayer.release(); - resourceHolder.adsLoader.release(); resourceHolder.imaServerSideAdInsertionMediaSource.setStreamManager( /* streamManager= */ null); + resourceHolder.adsLoader.release(); } State state = new State(ImmutableMap.copyOf(adPlaybackStateMap)); adPlaybackStateMap.clear();