@@ -492,7 +492,8 @@ def skipByStep(self, direction="positive", without_osd=False):
492
492
493
493
def skipByOffset (self , offset , without_osd = False ):
494
494
if offset is not None :
495
- self .seekByOffset (offset , without_osd = without_osd )
495
+ if not self .seekByOffset (offset , without_osd = without_osd ):
496
+ return
496
497
497
498
if self .useAutoSeek :
498
499
self .delayedSeek ()
@@ -729,19 +730,19 @@ def seekByOffset(self, offset, auto_seek=False, without_osd=False):
729
730
:param without_osd: indicates whether this seek was done with or without OSD
730
731
:return:
731
732
"""
733
+ lastSelectedOffset = self .selectedOffset
734
+ # If we are seeking forward and already past 5 seconds from end, don't seek at all
735
+ if lastSelectedOffset > self .duration - 5000 and offset > 0 :
736
+ return False
737
+
732
738
self ._seeking = True
733
739
self ._seekingWithoutOSD = without_osd
734
- lastSelectedOffset = self .selectedOffset
735
740
self .selectedOffset += offset
736
741
# Don't skip past 5 seconds from end
737
742
if self .selectedOffset > self .duration - 5000 :
738
- # If we are seeking forward and already past 5 seconds from end, don't seek at all
739
- if lastSelectedOffset > self .duration - 5000 :
740
- self .selectedOffset = lastSelectedOffset
741
- else :
742
- # offset = +100, at = 80000, duration = 80007, realoffset = 2
743
- self ._forcedLastSkipAmount = self .duration - 5000 - lastSelectedOffset
744
- self .selectedOffset = self .duration - 5000
743
+ # offset = +100, at = 80000, duration = 80007, realoffset = 2
744
+ self ._forcedLastSkipAmount = self .duration - 5000 - lastSelectedOffset
745
+ self .selectedOffset = self .duration - 5000
745
746
# Don't skip back past 1 (0 is handled specially so seeking to 0 will not do a seek)
746
747
elif self .selectedOffset < 1 :
747
748
# offset = -100, at = 5, realat = -95, realoffset = 1 - 5 = -4
@@ -753,6 +754,7 @@ def seekByOffset(self, offset, auto_seek=False, without_osd=False):
753
754
if auto_seek :
754
755
self .resetAutoSeekTimer ()
755
756
self .bigSeekHideTimer .reset ()
757
+ return True
756
758
757
759
def seekMouse (self , action , without_osd = False , preview = False ):
758
760
x = self .mouseXTrans (action .getAmount1 ())
0 commit comments