File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -999,7 +999,8 @@ def clearTextures(self):
999
999
of your stimulus, so doesn't need calling explicitly by the user.
1000
1000
"""
1001
1001
GL .glDeleteTextures (1 , self ._texID )
1002
- GL .glDeleteTextures (1 , self ._maskID )
1002
+ if hasattr (self , '_maskID' ):
1003
+ GL .glDeleteTextures (1 , self ._maskID )
1003
1004
1004
1005
@attributeSetter
1005
1006
def mask (self , value ):
Original file line number Diff line number Diff line change 38
38
from psychopy import logging , prefs #adding prefs to be able to check sound lib -JK
39
39
from psychopy .tools .arraytools import val2array
40
40
from psychopy .tools .attributetools import logAttrib , setAttribute
41
- from psychopy .visual .basevisual import BaseVisualStim , ContainerMixin
41
+ from psychopy .visual .basevisual import BaseVisualStim , ContainerMixin , TextureMixin
42
42
43
43
from moviepy .video .io .VideoFileClip import VideoFileClip
44
44
50
50
import pyglet .gl as GL
51
51
52
52
53
- class MovieStim3 (BaseVisualStim , ContainerMixin ):
53
+ class MovieStim3 (BaseVisualStim , ContainerMixin , TextureMixin ):
54
54
"""A stimulus class for playing movies (mpeg, avi, etc...) in PsychoPy
55
55
that does not require avbin. Instead it requires the cv2 python package
56
56
for OpenCV. The VLC media player also needs to be installed on the
@@ -467,11 +467,8 @@ def _getAudioStreamTime(self):
467
467
return self ._audio_stream_clock .getTime ()
468
468
469
469
def _unload (self ):
470
- try :
471
- # remove textures from graphics card to prevent crash
472
- self .clearTextures ()
473
- except Exception :
474
- pass
470
+ # remove textures from graphics card to prevent crash
471
+ self .clearTextures ()
475
472
if self ._mov is not None :
476
473
self ._mov .close ()
477
474
self ._mov = None
You can’t perform that action at this time.
0 commit comments