From 7ea82f6124ff35ede9e425c09f5c8b94fe2adb01 Mon Sep 17 00:00:00 2001 From: Vasily Date: Mon, 27 Apr 2020 18:43:39 +0300 Subject: [PATCH] Fix .ASS offset when seeking a progressive stream This is needed because progressive stream is actually restarted upon each seek --- src/components/htmlvideoplayer/plugin.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/htmlvideoplayer/plugin.js b/src/components/htmlvideoplayer/plugin.js index d3e3b3640f..85b264da04 100644 --- a/src/components/htmlvideoplayer/plugin.js +++ b/src/components/htmlvideoplayer/plugin.js @@ -602,7 +602,7 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa // if .ass currently rendering if (currentSubtitlesOctopus) { updateCurrentTrackOffset(offsetValue); - currentSubtitlesOctopus.timeOffset = offsetValue; + currentSubtitlesOctopus.timeOffset = (self._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 + offsetValue; } else { var trackElement = getTextTrack(); // if .vtt currently rendering @@ -860,7 +860,11 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa loading.hide(); htmlMediaHelper.seekOnPlaybackStart(self, e.target, self._currentPlayOptions.playerStartPositionTicks, function () { - if (currentSubtitlesOctopus) currentSubtitlesOctopus.resize(); + if (currentSubtitlesOctopus) { + currentSubtitlesOctopus.timeOffset = (self._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 + currentTrackOffset; + currentSubtitlesOctopus.resize(); + currentSubtitlesOctopus.resetRenderAheadCache(false); + } }); if (self._currentPlayOptions.fullscreen) { @@ -1066,6 +1070,7 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa onError: function() { htmlMediaHelper.onErrorInternal(self, 'mediadecodeerror'); }, + timeOffset: (self._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000, // new octopus options; override all, even defaults renderMode: 'blend',