fix: Refactor Subtitle DeltaTimes Calculation #122
Merged
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.
PR resolves #121
It does this by having the obligatory dummy subtitle track be based on loaded subtitles when appropriate and not always on video segments.
In the case where the loaded subtitles only got 'larger' subtitle segments, and need to be spliced through a splicing-endpoint, ie. dummy splice segments are used instead. Then the dummy subtitle segments shall be based on these splice segments rather than the original 'larger' subtitle segments.
(!) Also, a behavior correction has been implemented in this PR.
When
expectedSubtitleTracks
option is used. The expected tracks which never received any matching segments on load, will instead be given dummy subtitle segments, so that the tracks will always be filled with some kind of segments.Previously, they were kept empty if nothing was loaded, and so when trying to get segments you'll receive an empty list of segments and the resulting m3u8 file would be blank.