diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2015-06-15 11:58:01 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2015-06-15 11:58:01 +0000 |
commit | 6fead7b2c5fd7dc4ccac67c5e19311ac2a3bf1ab (patch) | |
tree | 45c5ade191d326bb07123037602f69f682a8b6be | |
parent | 67c6e9804546b684c8c17ac3698d3623aed3e7af (diff) | |
download | libgphoto2-6fead7b2c5fd7dc4ccac67c5e19311ac2a3bf1ab.tar.gz |
wait a bit on busy from nikon capture 2
free objectinfo
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15461 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r-- | camlibs/ptp2/library.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index e0ae4efb6..370ecdcf1 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -2675,6 +2675,7 @@ camera_nikon_capture (Camera *camera, CameraCaptureType type, CameraFilePath *pa int loops = 100; do { ret = ptp_nikon_capture2(params,af,sdram); + if (ret == PTP_RC_DeviceBusy) usleep(2000); } while ((ret == PTP_RC_DeviceBusy) && loops--); goto capturetriggered; } @@ -2838,6 +2839,8 @@ capturetriggered: /* delete last / or we get confused later. */ path->folder[ strlen(path->folder)-1 ] = '\0'; + ptp_free_objectinfo(&oi); + /* not doing the rest of the burst loop ... */ return gp_filesystem_append (camera->fs, path->folder, path->name, context); } @@ -3718,6 +3721,7 @@ camera_trigger_capture (Camera *camera, GPContext *context) ret = ptp_nikon_capture2 (params, !inliveview, sdram); if ((ret != PTP_RC_OK) && (ret != PTP_RC_DeviceBusy)) return translate_ptp_result (ret); + if (ret == PTP_RC_DeviceBusy) usleep(2000); /* sleep a bit perhaps ? or check events? */ } while (ret == PTP_RC_DeviceBusy); |