Commit 7d221150 by bachinger Committed by Tofunmi Adigun-Hameed

Do not reset period uid when DashMediaSource is released

When the source is prepared again after stop, the period uid
is calculated by subtracting the `firstPeriodId` from the
period uid that is passed in to `createPeriod`. When this
happens after stop, the uid from the old period uid that
is still stored and has the value of the last played uid.

Hence the `firstPeriodId` must not be reset when released.

Issue: google/ExoPlayer#10838
PiperOrigin-RevId: 539028570
(cherry picked from commit de2ad14f46f4790063dfef849ba8cc0069f6106e)
parent 958c3596
...@@ -523,7 +523,7 @@ public final class DashMediaSource extends BaseMediaSource { ...@@ -523,7 +523,7 @@ public final class DashMediaSource extends BaseMediaSource {
DrmSessionEventListener.EventDispatcher drmEventDispatcher = createDrmEventDispatcher(id); DrmSessionEventListener.EventDispatcher drmEventDispatcher = createDrmEventDispatcher(id);
DashMediaPeriod mediaPeriod = DashMediaPeriod mediaPeriod =
new DashMediaPeriod( new DashMediaPeriod(
firstPeriodId + periodIndex, /* id= */ firstPeriodId + periodIndex,
manifest, manifest,
baseUrlExclusionList, baseUrlExclusionList,
periodIndex, periodIndex,
...@@ -571,7 +571,6 @@ public final class DashMediaSource extends BaseMediaSource { ...@@ -571,7 +571,6 @@ public final class DashMediaSource extends BaseMediaSource {
elapsedRealtimeOffsetMs = C.TIME_UNSET; elapsedRealtimeOffsetMs = C.TIME_UNSET;
staleManifestReloadAttempt = 0; staleManifestReloadAttempt = 0;
expiredManifestPublishTimeUs = C.TIME_UNSET; expiredManifestPublishTimeUs = C.TIME_UNSET;
firstPeriodId = 0;
periodsById.clear(); periodsById.clear();
baseUrlExclusionList.reset(); baseUrlExclusionList.reset();
drmSessionManager.release(); drmSessionManager.release();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment