fileReadThread(): check return of read()
git-svn-id: http://moon:8086/svn/software/trunk/projects/opencv@328 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+2
-1
@@ -80,7 +80,8 @@ class VideoSource(RgbProcessorAdapter):
|
||||
cap = cv2.VideoCapture(self.fileName)
|
||||
while not self.cancel:
|
||||
ret, frame = cap.read()
|
||||
self.write(frame)
|
||||
if ret:
|
||||
self.write(frame)
|
||||
time.sleep(1.0/self.framerate)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user