Skip to content

Commit

Permalink
Do not reset period uid when DashMediaSource is released
Browse files Browse the repository at this point in the history
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: #10838
PiperOrigin-RevId: 539028570
  • Loading branch information
marcbaechinger authored and tof-tof committed Jun 9, 2023
1 parent b7e7153 commit de2ad14
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ public MediaPeriod createPeriod(MediaPeriodId id, Allocator allocator, long star
DrmSessionEventListener.EventDispatcher drmEventDispatcher = createDrmEventDispatcher(id);
DashMediaPeriod mediaPeriod =
new DashMediaPeriod(
firstPeriodId + periodIndex,
/* id= */ firstPeriodId + periodIndex,
manifest,
baseUrlExclusionList,
periodIndex,
Expand Down Expand Up @@ -571,7 +571,6 @@ protected void releaseSourceInternal() {
elapsedRealtimeOffsetMs = C.TIME_UNSET;
staleManifestReloadAttempt = 0;
expiredManifestPublishTimeUs = C.TIME_UNSET;
firstPeriodId = 0;
periodsById.clear();
baseUrlExclusionList.reset();
drmSessionManager.release();
Expand Down

0 comments on commit de2ad14

Please sign in to comment.