Keep manifest in DashMediaSource after release

This is a fix for the fix in 319854d624. The original fix did
not reset the firstPeriodId to avoid any id clashes with future
updates. This however only works under the assumption that the
next manifest load at the next call to prepare() is exactly the
same as the current manifest. This is not true unless the call
happens very quickly (and may fail even then). Instead we should
keep the existing manifest directly as a reference so we can use
it to find the number of removed periods when we get a new manifest
at the next call to prepare().

Issue: androidx/media#1329
PiperOrigin-RevId: 634853524
This commit is contained in:
tonihei 2024-05-17 12:22:56 -07:00 committed by Copybara-Service
parent 6abb2db1c6
commit b645004902
2 changed files with 3 additions and 1 deletions

View File

@ -161,6 +161,9 @@
* Fix bug where non-primary playlists keep reloading for LL-HLS streams
([#1240](https://github.com/androidx/media/issues/1240)).
* DASH Extension:
* Fix bug where re-preparing a multi-period live stream can throw an
`IndexOutOfBoundsException`
([#1329](https://github.com/androidx/media/issues/1329)).
* Smooth Streaming Extension:
* RTSP Extension:
* Decoder Extensions (FFmpeg, VP9, AV1, MIDI, etc.):

View File

@ -604,7 +604,6 @@ public final class DashMediaSource extends BaseMediaSource {
}
manifestLoadStartTimestampMs = 0;
manifestLoadEndTimestampMs = 0;
manifest = sideloadedManifest ? manifest : null;
manifestUri = initialManifestUri;
manifestFatalError = null;
if (handler != null) {