summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2021-02-01 16:50:52 +0100
committerMarcus Meissner <marcus@jet.franken.de>2021-02-01 16:50:52 +0100
commit2cef36ef7ab06fa0519390c6ae66970370f50120 (patch)
treee6e0e7533b9003c6c0a78f6dee59aa1adedc3989
parentbba49cdb85c62d6ac9ddfa1f143bb6fae8825209 (diff)
downloadlibgphoto2-2cef36ef7ab06fa0519390c6ae66970370f50120.tar.gz
generic initiate capture path:
also allow ptp general error to pass, for nikon v1 https://github.com/gphoto/libgphoto2/issues/569
-rw-r--r--camlibs/ptp2/library.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index 9d1efd3b5..8935a973f 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -5386,11 +5386,12 @@ static int
camera_capture (Camera *camera, CameraCaptureType type, CameraFilePath *path,
GPContext *context)
{
- PTPContainer event;
- PTPParams *params = &camera->pl->params;
- uint32_t newobject = 0x0;
- int done,tries;
+ PTPContainer event;
+ PTPParams *params = &camera->pl->params;
+ uint32_t newobject = 0x0;
+ int done,tries;
PTPObjectHandles beforehandles;
+ uint16_t ptpres;
/* adjust if we ever do sound or movie capture */
if (type != GP_CAPTURE_IMAGE)
@@ -5508,7 +5509,10 @@ fallback:
* few seconds. moving down the code. (kil3r)
*/
CR (gp_port_set_timeout (camera->port, capture_timeout));
- C_PTP_REP (ptp_initiatecapture(params, 0x00000000, 0x00000000));
+ ptpres = LOG_ON_PTP_E (ptp_initiatecapture(params, 0x00000000, 0x00000000));
+ /* the V1 reports general error to us, but has actually captured ... so just ignore GeneralError. */
+ if ((ptpres != PTP_RC_OK) && (ptpres != PTP_RC_GeneralError))
+ CR(ptpres);
/* A word of comments is worth here.
* After InitiateCapture camera should report with ObjectAdded event
* all newly created objects. However there might be more than one