Skip to content

Commit

Permalink
[MSS] patch segment duration in case inconsistent segment times signa…
Browse files Browse the repository at this point in the history
…lisation in tfrf (#3440)
  • Loading branch information
Bertrand Berthelot committed Oct 29, 2020
1 parent d77584a commit b0e188f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mss/MssFragmentMoofProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ function MssFragmentMoofProcessor(config) {
segment.t -= parseFloat(segments[0].tManifest) - segments[0].t;
segment.tManifest = entry.fragment_absolute_time;
}

// Patch previous segment duration
let lastSegment = segments[segments.length - 1];
if (lastSegment.t + lastSegment.d !== segment.t) {
logger.debug('Patch segment duration - t = ', lastSegment.t + ', d = ' + lastSegment.d + ' => ' + (segment.t - lastSegment.t));
lastSegment.d = segment.t - lastSegment.t;
}

segments.push(segment);

// In case of static start-over streams, update content duration
Expand Down

0 comments on commit b0e188f

Please sign in to comment.