siku2 / script.service.sponsorblock

Kodi add-on for SponsorBlock
MIT License
124 stars 14 forks source link

Get current player's time after a delay instead of relying on seek target #28

Closed matejdro closed 2 years ago

matejdro commented 2 years ago

Currently this plugin uses offset of the onPlayBackSeek to get the seek time.

Unfortunately, this method only reports the optimistic seek target. Actual post-seek position can be different, for example due to the video keyframes. This causes the reported time to actually be couple of seconds early, which causes overshot and prevents skip from occurring.

PR fixes this by replacing the offset checking mechanism with simply waiting half a second after skip (to ensure getTime() reports proper value) and then recalculating next checkpoint as usual.

This fixes #23