From c2d9960a6e3a6a790a11a3842e72f8cda5d6e946 Mon Sep 17 00:00:00 2001 From: Cai Yuanqing Date: Wed, 2 Oct 2019 13:25:26 +1300 Subject: [PATCH] Issue: #6501 Wrong segmentNumShift was calculated in copyWithNewRepresentation In DefaultDashChunkSource.copyWithNewRepresentation, it will handle the logic that new MPD manifest file is updated and calculate a newSegmentNumShift for furthermore segNum index calculation in getSegmentUrl, when a shorter window MPD updated and then back to a longer window MPD, copyWithNewRepresentation will go into the overlap case but the new index actually contains the old index.. --- .../android/exoplayer2/source/dash/DefaultDashChunkSource.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java index cd39c9538a..14fe81f605 100644 --- a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java +++ b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java @@ -700,6 +700,8 @@ public class DefaultDashChunkSource implements DashChunkSource { // There's a gap between the old index and the new one which means we've slipped behind the // live window and can't proceed. throw new BehindLiveWindowException(); + } else if (oldIndex.getFirstSegmentNum() >= newIndexFirstSegmentNum) { + // The new index contains the old one, continue process the next segment } else { // The new index overlaps with the old one. newSegmentNumShift +=