This commit is contained in:
yumoqing 2022-09-21 16:18:23 +08:00
parent aa71b8ecb9
commit 26d6d804ce

View File

@ -361,13 +361,13 @@ class FFVideo(WidgetReady, Image):
self.video_ts = val self.video_ts = val
if self.last_val is None: if self.last_val is None:
self.last_val = val self.last_val = val
self.do_update() self._update_task = Clock.schedule_once(self.do_update, 0)
else: else:
t = val - self.last_val t = val - self.last_val
if t > 0: if t > 0:
self._update_task = Clock.schedule_once(self.do_update, t) self._update_task = Clock.schedule_once(self.do_update, t)
else: else:
self.do_update() self._update_task = Clock.schedule_once(self.do_update, 0)
def do_update(self, *args): def do_update(self, *args):
self.position = self._player.get_pts() self.position = self._player.get_pts()
@ -379,5 +379,5 @@ class FFVideo(WidgetReady, Image):
self.show_others(img) self.show_others(img)
self.dispatch('on_frame', self.last_frame) self.dispatch('on_frame', self.last_frame)
self.last_frame = None self.last_frame = None
self.video_handle() Clock.schedule_once(self.video_handle, 0)