@@ -485,7 +485,8 @@ def skipByStep(self, direction="positive", without_osd=False):
485
485
486
486
def skipByOffset (self , offset , without_osd = False ):
487
487
if offset is not None :
488
- self .seekByOffset (offset , without_osd = without_osd )
488
+ if not self .seekByOffset (offset , without_osd = without_osd ):
489
+ return
489
490
490
491
if self .useAutoSeek :
491
492
self .delayedSeek ()
@@ -720,19 +721,19 @@ def seekByOffset(self, offset, auto_seek=False, without_osd=False):
720
721
:param without_osd: indicates whether this seek was done with or without OSD
721
722
:return:
722
723
"""
724
+ lastSelectedOffset = self .selectedOffset
725
+ # If we are seeking forward and already past 5 seconds from end, don't seek at all
726
+ if lastSelectedOffset > self .duration - 5000 and offset > 0 :
727
+ return False
728
+
723
729
self ._seeking = True
724
730
self ._seekingWithoutOSD = without_osd
725
- lastSelectedOffset = self .selectedOffset
726
731
self .selectedOffset += offset
727
732
# Don't skip past 5 seconds from end
728
733
if self .selectedOffset > self .duration - 5000 :
729
- # If we are seeking forward and already past 5 seconds from end, don't seek at all
730
- if lastSelectedOffset > self .duration - 5000 :
731
- self .selectedOffset = lastSelectedOffset
732
- else :
733
- # offset = +100, at = 80000, duration = 80007, realoffset = 2
734
- self ._forcedLastSkipAmount = self .duration - 5000 - lastSelectedOffset
735
- self .selectedOffset = self .duration - 5000
734
+ # offset = +100, at = 80000, duration = 80007, realoffset = 2
735
+ self ._forcedLastSkipAmount = self .duration - 5000 - lastSelectedOffset
736
+ self .selectedOffset = self .duration - 5000
736
737
# Don't skip back past 1 (0 is handled specially so seeking to 0 will not do a seek)
737
738
elif self .selectedOffset < 1 :
738
739
# offset = -100, at = 5, realat = -95, realoffset = 1 - 5 = -4
@@ -744,6 +745,7 @@ def seekByOffset(self, offset, auto_seek=False, without_osd=False):
744
745
if auto_seek :
745
746
self .resetAutoSeekTimer ()
746
747
self .bigSeekHideTimer .reset ()
748
+ return True
747
749
748
750
def seekMouse (self , action , without_osd = False , preview = False ):
749
751
x = self .mouseXTrans (action .getAmount1 ())
0 commit comments