From 8351654fb0c884bcaaf032588d29df503350602e Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Fri, 10 Apr 2015 09:55:09 +0200 Subject: ufo: read stale frames after recording On a reasonably fast machine this might take up to 0.1 seconds. --- plugins/ufo/uca-ufo-camera.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/ufo/uca-ufo-camera.c b/plugins/ufo/uca-ufo-camera.c index d7a5894..4f9a15c 100644 --- a/plugins/ufo/uca-ufo-camera.c +++ b/plugins/ufo/uca-ufo-camera.c @@ -331,10 +331,13 @@ uca_ufo_camera_start_recording(UcaCamera *camera, GError **error) } static void -uca_ufo_camera_stop_recording(UcaCamera *camera, GError **error) +uca_ufo_camera_stop_recording (UcaCamera *camera, GError **error) { UcaUfoCameraPrivate *priv; UcaCameraTriggerSource trigger_source; + pcilib_event_id_t event_id; + pcilib_event_info_t event_info; + g_return_if_fail(UCA_IS_UFO_CAMERA(camera)); priv = UCA_UFO_CAMERA_GET_PRIVATE(camera); @@ -350,6 +353,10 @@ uca_ufo_camera_stop_recording(UcaCamera *camera, GError **error) g_thread_join(priv->async_thread); priv->async_thread = NULL; } + + /* read stale frames ... */ + while (!pcilib_get_next_event (priv->handle, priv->timeout, &event_id, sizeof (pcilib_event_info_t), &event_info)) + ; } static void -- cgit v1.2.3