summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2020-09-18 10:09:58 +0200
committerMarcus Meissner <marcus@jet.franken.de>2020-09-18 10:09:58 +0200
commit695680fb3dee8475218e23e6ba7c4269aed3054e (patch)
tree1fbcf42eff0670059081c9b92d86a89247b69625
parent3db5b9502fad1e7c72218041e229abcd65ea4447 (diff)
downloadlibgphoto2-695680fb3dee8475218e23e6ba7c4269aed3054e.tar.gz
Revert "remove wait logic which caused a way lower framerate than we want"
This reverts commit e2ad1cb2ae63b031632a1198ec048f378eabe229. see https://github.com/gphoto/libgphoto2/issues/562
-rw-r--r--camlibs/ptp2/library.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index 6579c5a46..9afb07d6b 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -3155,6 +3155,7 @@ camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context)
* enough (would be 0.2 seconds, too short for the mirror up operation.). */
/* The EOS 100D takes 1.2 seconds */
PTPDevicePropDesc dpd;
+ int back_off_wait = 0;
struct timeval event_start;
SET_CONTEXT_P(params, context);
@@ -3193,7 +3194,6 @@ camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context)
event_start = time_now();
do {
unsigned char *xdata;
-
/* Poll for camera events, but just call
* it once and do not drain the queue now */
C_PTP (ptp_check_eos_events (params));
@@ -3201,9 +3201,7 @@ camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context)
ret = ptp_canon_eos_get_viewfinder_image (params , &data, &size);
if ((ret == 0xa102) || (ret == PTP_RC_DeviceBusy)) { /* means "not there yet" ... so wait */
/* wait 3 seconds at most */
- /*if (waiting_for_timeout (&back_off_wait, event_start, 3*1000))*/
- /* We do not queue a wait here... this will only reduce framerates */
- if (time_since (event_start) < 3*1000)
+ if (waiting_for_timeout (&back_off_wait, event_start, 3*1000))
continue;
}
C_PTP_MSG (ret, "get_viewfinder_image failed");