fix: account for difference between duration info in the playlist and the actual duration #1470
+14
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
we should account for the difference between the duration info in the manifest and the actual duration of the segment when selecting next segment after quality change.
Assume we have the following playlist:
Assume we already appended two segments, so
bufferend.end
should be20
, but we don't have an exact duration match between the playlist and the actual segment duration, so we receive it as19.99999..
.Currently, we select segment-2.ts instead of segment-3.ts because we do not account for this timestamp fluctuation.
Specific Changes proposed
Check whether we hit timestamp fluctuation by adding
TIME_FUDGE_FACTOR
(1 / 30).Requirements Checklist