mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Refine last segment calculation.
This makes the calculation correct for the case where periodDurationMs does not divide exactly into durationMs.
This commit is contained in:
parent
e538181112
commit
a64df69f85
1 changed files with 1 additions and 1 deletions
|
|
@ -301,7 +301,7 @@ public abstract class SegmentBase {
|
||||||
return DashSegmentIndex.INDEX_UNBOUNDED;
|
return DashSegmentIndex.INDEX_UNBOUNDED;
|
||||||
} else {
|
} else {
|
||||||
long durationMs = (duration * 1000) / timescale;
|
long durationMs = (duration * 1000) / timescale;
|
||||||
return startNumber + (int) (periodDurationMs / durationMs) - 1;
|
return startNumber + (int) ((periodDurationMs + durationMs - 1) / durationMs) - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue