summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-07-26 15:34:45 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-07-26 15:34:45 +0000
commitca35809e34a721e5a28b9bff823de57f762fa61a (patch)
tree58e20b11a88d71f61e93a6b2babbe3fa4d4d9d88
parentd75f10e2a95596510d9031d7de2b91e3940e8886 (diff)
downloadlibgphoto2-ca35809e34a721e5a28b9bff823de57f762fa61a.tar.gz
drain all ptp events from the queue before capture starts,
this avoids accumulation and increasing delays between capture git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15114 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r--camlibs/ptp2/library.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index e09884319..f5041882a 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -3176,6 +3176,11 @@ camera_capture (Camera *camera, CameraCaptureType type, CameraFilePath *path,
SET_CONTEXT_P(params, context);
camera->pl->checkevents = TRUE;
+ /* first, draing existing events if the caller did not do it. */
+ while (ptp_get_one_event(params, &event)) {
+ GP_LOG_D ("draining unhandled event Code %04x, Param 1 %08x", event.Code, event.Param1);
+ }
+
/* 3rd gen style nikon capture, can do both sdram and card */
if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_NIKON) &&
ptp_operation_issupported(params, PTP_OC_NIKON_InitiateCaptureRecInMedia)