Skip to content

Commit 0854a96

Browse files
committed
!video fixes
1 parent fc7635d commit 0854a96

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.flake8

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[flake8]
22
max_line_length = 160
3-
max_complexity = 30
4-
3+
max_complexity = 35

src/flitter/cache.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ def read_video_frames(self, obj, position, loop=False, back_and_forth=False, tri
254254
if container is not None:
255255
if position is None:
256256
logger.debug("Closing video: {}", self._path)
257-
decoder.close()
257+
if decoder is not None:
258+
decoder.close()
258259
container.close()
259260
container = decoder = None
260261
frames = []

src/flitter/render/window/video.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def render(self, node, references, **kwargs):
6767
self._frame0 = None
6868
self._frame1 = None
6969
if frame0 is None:
70-
self.framebuffer.clear()
70+
if self._target is not None:
71+
self._target.release()
72+
self._target = None
7173
return
7274
frame_size = frame0.width, frame0.height
7375
if self._frame0_texture is None:

0 commit comments

Comments
 (0)