Fix: Subtitle Track Playhead is dependant Of Video Track #302
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.
The Playhead speed for the different tracks in the CE is different for video tracks and audio tracks. However, subtitle tracks were initially assumed to always have segments of durations equal to their video segment counterparts, so the playhead speed for subtitle tracks would just follow the one for video. This does not work that well if the subtitle track segments are different from video track segments. The media sequence for subtitles would lag behind. Subtitle segments would get out of sync with video.
This PR solves this issue by using an updated version of
@eyevinn/hls-vodtolive
where the "deltaTimesSubtitle" list now contains more accurate values. Making it possible for subtitle tracks to have an independent playhead speed. The media sequence for subtitles should now 'fast-forward' when needed in order to have the content positions for Video, Audio, and Subtitles aligned. (audio and subtitle positions are allowed to be ahead of video, but never more than a segment duraiton)New debug logging is added too, so that it is clear where the tracks are position wise.