mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Fix second sync point calculation for unbounded live streams.
We currently use INDEX_UNBOUNDED for the calculation and don't offset the index by the firstSegmentNum if not unbounded. PiperOrigin-RevId: 348445797
This commit is contained in:
parent
686d11de1b
commit
696bb34ac6
1 changed files with 5 additions and 1 deletions
|
|
@ -195,8 +195,12 @@ public class DefaultDashChunkSource implements DashChunkSource {
|
|||
if (representationHolder.segmentIndex != null) {
|
||||
long segmentNum = representationHolder.getSegmentNum(positionUs);
|
||||
long firstSyncUs = representationHolder.getSegmentStartTimeUs(segmentNum);
|
||||
int segmentCount = representationHolder.getSegmentCount();
|
||||
long secondSyncUs =
|
||||
firstSyncUs < positionUs && segmentNum < representationHolder.getSegmentCount() - 1
|
||||
firstSyncUs < positionUs
|
||||
&& (segmentCount == DashSegmentIndex.INDEX_UNBOUNDED
|
||||
|| segmentNum
|
||||
< representationHolder.getFirstSegmentNum() + segmentCount - 1)
|
||||
? representationHolder.getSegmentStartTimeUs(segmentNum + 1)
|
||||
: firstSyncUs;
|
||||
return seekParameters.resolveSeekPositionUs(positionUs, firstSyncUs, secondSyncUs);
|
||||
|
|
|
|||
Loading…
Reference in a new issue