diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 6655ad2bc..d72d926b6 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -1693,6 +1693,7 @@ camera_canon_eos_capture (Camera *camera, CameraCaptureType type, CameraFilePath unsigned char *ximage = NULL; static int capcnt = 0; PTPObjectInfo oi; + int sleepcnt = 1; time_t capture_start=time(NULL); if (!ptp_operation_issupported(params, PTP_OC_CANON_EOS_RemoteRelease)) { @@ -1734,10 +1735,15 @@ camera_canon_eos_capture (Camera *camera, CameraCaptureType type, CameraFilePath } if (!nrofentries) { free (entries); - gp_context_idle (context); - usleep(100*1000); /* 100 ms */ + for (i=sleepcnt;i--;) { + gp_context_idle (context); + usleep(20*1000); /* 20 ms */ + } + sleepcnt++; /* incremental back off */ + if (sleepcnt>10) sleepcnt=10; continue; } + sleepcnt = 1; for (i=0;i10) sleepcnt=10; continue; } + sleepcnt = 1; for (i=0;i