VTi image...
config.usage.stop_seek_eof = ConfigSelection(default = "20", choices = [
("0", _("off")),
("10", "10 " + _("seconds")),
("20", "20 " + _("seconds")),
("30", "30 " + _("seconds")),
("60", "60 " + _("seconds"))])
InfoBarGenerics.py
class InfoBarSeek
self.seek_to_eof = int(config.usage.stop_seek_eof.value)
doSeekRelative:
def doSeekRelative(self, pts):
seekable = self.getSeek()
if seekable is None:
return
prevstate = self.seekstate
if self.seekstate == self.SEEK_STATE_EOF:
if prevstate == self.SEEK_STATE_PAUSE:
self.setSeekState(self.SEEK_STATE_PAUSE)
else:
self.setSeekState(self.SEEK_STATE_PLAY)
if self.seek_to_eof:
remaining = self.calcRemainingTime()
seek_interval = pts / 90
if remaining < seek_interval:
len = seekable.getLength()
play_pos = len[1] - (self.seek_to_eof*1000 * 90)
self.setSeekState(self.SEEK_STATE_PLAY)
seekable.seekTo(play_pos)
self.showAfterSeek()
return
seekable.seekRelative(pts<0 and -1 or 1, abs(pts))
if abs(pts) > 100 and config.usage.show_infobar_on_skip.value:
self.showAfterSeek()
__evEOF
def __evEOF(self):
if self.seekstate == self.SEEK_STATE_EOF:
return
# if we are seeking forward, we try to end up ~1s before the end, and pause there or seek_to_eof is set we skip back and switch to play mode.
seekstate = self.seekstate
if self.seekstate != self.SEEK_STATE_PAUSE:
seekable = self.getSeek()
if self.seek_to_eof and seekable and self.seekstate != self.SEEK_STATE_PLAY:
len = seekable.getLength()
play_pos = len[1] - (self.seek_to_eof*1000 * 90)
self.setSeekState(self.SEEK_STATE_PLAY)
seekable.seekTo(play_pos)
return
else:
self.setSeekState(self.SEEK_STATE_EOF)
if seekstate not in (self.SEEK_STATE_PLAY, self.SEEK_STATE_PAUSE): # if we are seeking
seekable = self.getSeek()
if seekable is not None:
seekable.seekTo(-1)
if seekstate == self.SEEK_STATE_PLAY: # regular EOF
self.doEofInternal(True)
else:
self.doEofInternal(False)
doSeekRelative works ok.
__evEOF not correctly for Pli image.Problem in:
if self.seek_to_eof and seekable and self.seekstate != self.SEEK_STATE_PLAY:
Edited by Dima73, 12 July 2013 - 21:02.