diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-04-10 09:55:09 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-04-10 09:55:09 +0200 |
commit | 8351654fb0c884bcaaf032588d29df503350602e (patch) | |
tree | 3c401adc26f292ade9bbe9976bac5acca9eaef5e /plugins/ufo/uca-ufo-camera.c | |
parent | 1527e795bebd77fcbc8bdc1d5d4f7ff4fd4a59ce (diff) | |
download | libuca-8351654fb0c884bcaaf032588d29df503350602e.tar.gz libuca-8351654fb0c884bcaaf032588d29df503350602e.tar.bz2 libuca-8351654fb0c884bcaaf032588d29df503350602e.tar.xz libuca-8351654fb0c884bcaaf032588d29df503350602e.zip |
ufo: read stale frames after recording
On a reasonably fast machine this might take up to 0.1 seconds.
Diffstat (limited to 'plugins/ufo/uca-ufo-camera.c')
-rw-r--r-- | plugins/ufo/uca-ufo-camera.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 |