mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +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;
|
||||
} else {
|
||||
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