Merge pull request #6502 from caiiiyua:bug_default_dash_chunk_source_wrong_segmentnumshift
PiperOrigin-RevId: 273549830
This commit is contained in:
commit
4026c8a01e
@ -686,7 +686,9 @@ public class DefaultDashChunkSource implements DashChunkSource {
|
||||
newPeriodDurationUs, newRepresentation, extractorWrapper, segmentNumShift, newIndex);
|
||||
}
|
||||
|
||||
long oldIndexLastSegmentNum = oldIndex.getFirstSegmentNum() + oldIndexSegmentCount - 1;
|
||||
long oldIndexFirstSegmentNum = oldIndex.getFirstSegmentNum();
|
||||
long oldIndexStartTimeUs = oldIndex.getTimeUs(oldIndexFirstSegmentNum);
|
||||
long oldIndexLastSegmentNum = oldIndexFirstSegmentNum + oldIndexSegmentCount - 1;
|
||||
long oldIndexEndTimeUs =
|
||||
oldIndex.getTimeUs(oldIndexLastSegmentNum)
|
||||
+ oldIndex.getDurationUs(oldIndexLastSegmentNum, newPeriodDurationUs);
|
||||
@ -700,8 +702,14 @@ 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 (newIndexStartTimeUs < oldIndexStartTimeUs) {
|
||||
// The new index overlaps with (but does not have a start position contained within) the old
|
||||
// index. This can only happen if extra segments have been added to the start of the index.
|
||||
newSegmentNumShift -=
|
||||
newIndex.getSegmentNum(oldIndexStartTimeUs, newPeriodDurationUs)
|
||||
- oldIndexFirstSegmentNum;
|
||||
} else {
|
||||
// The new index overlaps with the old one.
|
||||
// The new index overlaps with (and has a start position contained within) the old index.
|
||||
newSegmentNumShift +=
|
||||
oldIndex.getSegmentNum(newIndexStartTimeUs, newPeriodDurationUs)
|
||||
- newIndexFirstSegmentNum;
|
||||
|
Loading…
x
Reference in New Issue
Block a user