Skip to content

Commit

Permalink
Merge pull request #2932 from video-dev/bugfix/do-not-use-shorter-tra…
Browse files Browse the repository at this point in the history
…ck-duration-at-discontinuity

Fix stream duration update regression with discontinuities and misaligned AV
  • Loading branch information
robwalch committed Jul 30, 2020
2 parents 20cd617 + 484cac9 commit 1b2cd57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controller/level-helper.js
Expand Up @@ -46,7 +46,8 @@ export function updatePTS (fragments, fromIdx, toIdx) {
} else {
// we dont know startPTS[toIdx]
if (toIdx > fromIdx) {
fragTo.start = fragFrom.start + (fragFrom.minEndPTS ? fragFrom.minEndPTS - fragFrom.start : fragFrom.duration);
const contiguous = fragFrom.cc === fragTo.cc;
fragTo.start = fragFrom.start + ((contiguous && fragFrom.minEndPTS) ? fragFrom.minEndPTS - fragFrom.start : fragFrom.duration);
} else {
fragTo.start = Math.max(fragFrom.start - fragTo.duration, 0);
}
Expand Down

0 comments on commit 1b2cd57

Please sign in to comment.