mirror of
https://github.com/samsonjs/media.git
synced 2026-04-05 11:15:46 +00:00
Check the new index contains the old index based on stat time instead of segNum
This commit is contained in:
parent
c2d9960a6e
commit
9ec94a4bdc
1 changed files with 6 additions and 2 deletions
|
|
@ -686,6 +686,8 @@ public class DefaultDashChunkSource implements DashChunkSource {
|
|||
newPeriodDurationUs, newRepresentation, extractorWrapper, segmentNumShift, newIndex);
|
||||
}
|
||||
|
||||
long oldIndexFirstSegmentNum = oldIndex.getFirstSegmentNum();
|
||||
long oldIndexStartTimeUs = oldIndex.getTimeUs(oldIndexFirstSegmentNum);
|
||||
long oldIndexLastSegmentNum = oldIndex.getFirstSegmentNum() + oldIndexSegmentCount - 1;
|
||||
long oldIndexEndTimeUs =
|
||||
oldIndex.getTimeUs(oldIndexLastSegmentNum)
|
||||
|
|
@ -700,8 +702,10 @@ 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 if (oldIndexStartTimeUs >= newIndexStartTimeUs) {
|
||||
// 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.
|
||||
// Continue process the next segment as is.
|
||||
} else {
|
||||
// The new index overlaps with the old one.
|
||||
newSegmentNumShift +=
|
||||
|
|
|
|||
Loading…
Reference in a new issue