From 3687f0da45be0cb4c0fc26adeac8ea1bdb5f1a67 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 30 Jul 2017 12:31:21 +0200 Subject: [PATCH] emit capture complete event for EOS Cameras (using CameraStatus 0) partial fix for https://github.com/gphoto/gphoto2/issues/32 --- camlibs/ptp2/library.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 85c5138c5..6fa378e6d 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -4933,9 +4933,14 @@ camera_wait_for_event (Camera *camera, int timeout, return GP_OK; case PTP_CANON_EOS_CHANGES_TYPE_CAMERASTATUS: /* if we do capture stuff, camerastatus will turn to 0 when done */ - *eventtype = GP_EVENT_UNKNOWN; - C_MEM (*eventdata = malloc(strlen("Camera Status 123456789012345")+1)); - sprintf (*eventdata, "Camera Status %d", entry.u.status); + if (entry.u.status == 0) { + *eventtype = GP_EVENT_CAPTURE_COMPLETE; + *eventdata = NULL; + } else { + *eventtype = GP_EVENT_UNKNOWN; + C_MEM (*eventdata = malloc(strlen("Camera Status 123456789012345")+1)); + sprintf (*eventdata, "Camera Status %d", entry.u.status); + } return GP_OK; case PTP_CANON_EOS_CHANGES_TYPE_FOCUSINFO: *eventtype = GP_EVENT_UNKNOWN;