summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2015-12-26 20:25:19 +0100
committerMarcus Meissner <marcus@jet.franken.de>2015-12-26 20:25:19 +0100
commitc60256d9b262952b4ba448b4d5be539c8c937d2c (patch)
tree1324ca9b5c65a917f6eb6c09747c1ef93145c8b4
parent35081ae9ec1475973066c26c3c1f876db6a58d08 (diff)
downloadlibgphoto2-c60256d9b262952b4ba448b4d5be539c8c937d2c.tar.gz
if we get a 2009 error from deleting sdram pictures, remember this
and do not try again, as this confuses the D750 fixes https://github.com/gphoto/libgphoto2/issues/22
-rw-r--r--camlibs/ptp2/library.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index bcc836ba0..dec164993 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -3002,12 +3002,19 @@ capturetriggered:
/* this does result in 0x2009 (invalid object id) with the D90 ... curiuos
ret = ptp_nikon_delete_sdram_image (params, newobject);
*/
- ret = ptp_deleteobject (params, newobject, 0);
- if (ret != PTP_RC_OK) {
- GP_LOG_E ("deleteobject(%x) failed: %x", newobject, ret);
- ret = ptp_nikon_delete_sdram_image (params, newobject);
- if (ret != PTP_RC_OK)
- GP_LOG_E ("deleteobjectinsdram(%x) failed too: %x", newobject, ret);
+ if (!params->deletesdramfails) {
+ ret = ptp_deleteobject (params, newobject, 0);
+ if (ret != PTP_RC_OK) {
+ GP_LOG_E ("deleteobject(%x) failed: %x", newobject, ret);
+ if (ret == PTP_RC_InvalidObjectHandle)
+ params->deletesdramfails = 1;
+ else
+ ret = ptp_nikon_delete_sdram_image (params, newobject);
+ if (ret != PTP_RC_OK)
+ GP_LOG_E ("deleteobjectinsdram(%x) failed too: %x", newobject, ret);
+ if (ret == PTP_RC_InvalidObjectHandle)
+ params->deletesdramfails = 1;
+ }
}
} else { /* capture to card branch */
CR (add_object (camera, newobject, context));