diff --git a/camlibs/ptp2/ChangeLog b/camlibs/ptp2/ChangeLog index 2cfe53ff9..f36a571f9 100644 --- a/camlibs/ptp2/ChangeLog +++ b/camlibs/ptp2/ChangeLog @@ -1,3 +1,8 @@ +2008-03-31 Marcus Meissner + + * ptp.c, ptp.h, config.c: Try to fix EOS capture preparation, + by doing a real ptp_eos_getstorageids. + 2008-03-15 Marcus Meissner * library.c: Adjust for GPPortInfo change. diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index e02098190..5701af35c 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -149,6 +149,7 @@ camera_prepare_canon_eos_capture(Camera *camera, GPContext *context) { PTPCanon_changes_entry *entries = NULL; int nrofentries = 0; unsigned char startup9110[12]; + PTPStorageIDs sids; ret = ptp_canon_eos_setremotemode(params, 1); if (ret != PTP_RC_OK) { @@ -191,25 +192,17 @@ camera_prepare_canon_eos_capture(Camera *camera, GPContext *context) { gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_capture", "getdeviceinfo failed!"); return GP_ERROR; } - ret = ptp_canon_eos_getstorageids(params); + ret = ptp_canon_eos_getstorageids(params, &sids); if (ret != PTP_RC_OK) { gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_capture", "9101 failed!"); return GP_ERROR; } - ret = ptp_canon_eos_getstorageinfo(params, 1); - if (ret != PTP_RC_OK) { - gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_capture", "9102 failed!"); - return GP_ERROR; - } - ret = ptp_canon_eos_getstorageids(params); - if (ret != PTP_RC_OK) { - gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_capture", "9101 failed!"); - return GP_ERROR; - } - ret = ptp_canon_eos_getstorageinfo(params, 1); - if (ret != PTP_RC_OK) { - gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_capture", "9102 failed!"); - return GP_ERROR; + if (sids.n >= 1) { + ret = ptp_canon_eos_getstorageinfo(params, sids.Storage[0]); + if (ret != PTP_RC_OK) { + gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_capture", "9102 failed!"); + return GP_ERROR; + } } /* just exchange the value to 4 */ startup9110[8] = 0x04; startup9110[9] = 0x00; startup9110[10] = 0x00; startup9110[11] = 0x00; diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 26bebb68c..485a7bcd3 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -1424,6 +1424,7 @@ camera_canon_eos_capture (Camera *camera, CameraCaptureType type, CameraFilePath continue; } for (i=0;i