From 4f59a1e2a96817c7ac1edf4f856f25943bb236b1 Mon Sep 17 00:00:00 2001 From: croneter Date: Wed, 6 Nov 2019 18:39:19 +0100 Subject: [PATCH] Fix Kodi playback jumping to the beginning of a video that just started --- resources/lib/playback.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lib/playback.py b/resources/lib/playback.py index 245e6eca..de5220d0 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -28,6 +28,7 @@ LOG = getLogger('PLEX.playback') # Do we need to return ultimately with a setResolvedUrl? RESOLVE = True TRY_TO_SEEK_FOR = 300 # =30 seconds +IGNORE_SECONDS_AT_START = 15 ############################################################################### @@ -590,6 +591,13 @@ def threaded_playback(kodi_playlist, startpos, offset): if i > TRY_TO_SEEK_FOR: LOG.error('Could not seek to %s', offset) return + try: + if offset == 0 and app.APP.player.getTime() < IGNORE_SECONDS_AT_START: + LOG.debug('Avoiding small jump to the very start of the video') + return + except RuntimeError: + # RuntimeError: XBMC is not playing any media file + pass i = 0 answ = js.seek_to(offset * 1000) while 'error' in answ: