bugfix
This commit is contained in:
parent
0de9256384
commit
19fe20ac35
@ -33,6 +33,7 @@ class FFVideo(WidgetReady, Image):
|
|||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self._player = None
|
self._player = None
|
||||||
self._update_task = None
|
self._update_task = None
|
||||||
|
self.vh_task = None
|
||||||
self.is_black = False
|
self.is_black = False
|
||||||
self.videosize = None
|
self.videosize = None
|
||||||
self.ff_opts = {
|
self.ff_opts = {
|
||||||
@ -122,7 +123,6 @@ class FFVideo(WidgetReady, Image):
|
|||||||
if self.parent:
|
if self.parent:
|
||||||
return
|
return
|
||||||
self._play_stop()
|
self._play_stop()
|
||||||
del self
|
|
||||||
|
|
||||||
def on_startplay(self, *args):
|
def on_startplay(self, *args):
|
||||||
pass
|
pass
|
||||||
@ -147,12 +147,7 @@ class FFVideo(WidgetReady, Image):
|
|||||||
Line(points=[0,1,p,1], width=1)
|
Line(points=[0,1,p,1], width=1)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
if self._update_task:
|
self._play_stop()
|
||||||
self._update_task.cancel()
|
|
||||||
self._update_task = None
|
|
||||||
if self._player:
|
|
||||||
self._player.close_player()
|
|
||||||
self._player = None
|
|
||||||
|
|
||||||
def set_volume(self, v):
|
def set_volume(self, v):
|
||||||
if self.play_mode == 'preview':
|
if self.play_mode == 'preview':
|
||||||
@ -245,7 +240,6 @@ class FFVideo(WidgetReady, Image):
|
|||||||
self.status = 'pause'
|
self.status = 'pause'
|
||||||
|
|
||||||
def _play_start(self):
|
def _play_start(self):
|
||||||
self.timepass = 0.0
|
|
||||||
self.last_frame = None
|
self.last_frame = None
|
||||||
self.is_black = False
|
self.is_black = False
|
||||||
self.vsync = False
|
self.vsync = False
|
||||||
@ -260,18 +254,18 @@ class FFVideo(WidgetReady, Image):
|
|||||||
self.videosize = meta['src_vid_size']
|
self.videosize = meta['src_vid_size']
|
||||||
|
|
||||||
def _play_stop(self):
|
def _play_stop(self):
|
||||||
if self._player is None:
|
if self._player:
|
||||||
return
|
self._player.close_player()
|
||||||
|
self._player = None
|
||||||
if self._update_task:
|
if self._update_task:
|
||||||
self._update_task.cancel()
|
self._update_task.cancel()
|
||||||
self._update_task = None
|
self._update_task = None
|
||||||
self._player.close_player()
|
if self.vh_task:
|
||||||
self._player = None
|
self.vh_task.cancel()
|
||||||
self.timepass = 0
|
self.vh_task = None
|
||||||
self.next_frame = None
|
self.next_frame = None
|
||||||
self.duration = -1
|
self.duration = -1
|
||||||
self.position = 0
|
self.position = 0
|
||||||
self.frame_rate = None
|
|
||||||
self.videosize = None
|
self.videosize = None
|
||||||
|
|
||||||
def on_size(self, *args):
|
def on_size(self, *args):
|
||||||
@ -355,7 +349,7 @@ class FFVideo(WidgetReady, Image):
|
|||||||
if frame is None:
|
if frame is None:
|
||||||
self.set_black()
|
self.set_black()
|
||||||
self.last_val = None
|
self.last_val = None
|
||||||
Clock.schedule_once(self.video_handle, 0.1)
|
self.vh_task = Clock.schedule_once(self.video_handle, 0.1)
|
||||||
return
|
return
|
||||||
|
|
||||||
self. _get_video_info()
|
self. _get_video_info()
|
||||||
@ -381,5 +375,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
|
||||||
Clock.schedule_once(self.video_handle, 0)
|
self.vh_task = Clock.schedule_once(self.video_handle, 0)
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
__version__ = '0.3.19'
|
__version__ = '0.3.20'
|
||||||
|
Loading…
Reference in New Issue
Block a user