summaryrefslogtreecommitdiff
path: root/camlibs
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2022-09-27 10:50:37 +0200
committerMarcus Meissner <marcus@jet.franken.de>2022-09-27 10:50:37 +0200
commit8b462f8c835b9d3ab0cee4117e0b0458dac00445 (patch)
tree44d01a5e8f69a11e1dbfadd22c7ede4396aedaf5 /camlibs
parentfb2b1283531bcaccc628c234f2a4f5082d102b8e (diff)
downloadlibgphoto2-8b462f8c835b9d3ab0cee4117e0b0458dac00445.tar.gz
use the correct error handling method (C_PTP instead of CR)
restore timeout before returning fixes https://github.com/gphoto/libgphoto2/issues/835
Diffstat (limited to 'camlibs')
-rw-r--r--camlibs/ptp2/library.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index 2c34d5a88..c6f695411 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -5697,8 +5697,10 @@ fallback:
CR (gp_port_set_timeout (camera->port, capture_timeout));
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);
+ if ((ptpres != PTP_RC_OK) && (ptpres != PTP_RC_GeneralError)) {
+ CR (gp_port_set_timeout (camera->port, normal_timeout));
+ C_PTP (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