diff --git a/pupil_src/capture/world.py b/pupil_src/capture/world.py index ce5bbb18fa..a9139e6996 100644 --- a/pupil_src/capture/world.py +++ b/pupil_src/capture/world.py @@ -299,6 +299,17 @@ def reset_timebase(): # Event loop while not g_pool.quit.value: + # Get an image from the grabber + try: + frame = cap.get_frame() + except CameraCaptureError: + logger.error("Capture from Camera Failed. Stopping.") + break + except EndofVideoFileError: + logger.warning("Video File is done. Stopping") + break + + update_fps() #a container that allows plugins to post and read events events = [] @@ -313,19 +324,6 @@ def reset_timebase(): p['norm_gaze'] = g_pool.map_pupil(p['norm_pupil']) recent_pupil_positions.append(p) - # Get an image from the grabber - try: - frame = cap.get_frame() - except CameraCaptureError: - logger.error("Capture from Camera Failed. Stopping.") - break - except EndofVideoFileError: - logger.warning("Video File is done. Stopping") - break - - update_fps() - - # allow each Plugin to do its work. for p in g_pool.plugins: