diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2020-05-24 09:04:20 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2020-05-24 09:04:20 +0200 |
commit | cff2889eb2ff4b658b82c4e2516f609b289fb279 (patch) | |
tree | 942921366a73e97363cc087451ee403841c029e6 | |
parent | adcb6e76f4a160f17dcbef2584839a73a0c3b744 (diff) | |
download | libgphoto2-cff2889eb2ff4b658b82c4e2516f609b289fb279.tar.gz |
refetch storage ids after switching olympus to pc mode... lets see if this helps the filesystem presence
-rw-r--r-- | camlibs/ptp2/library.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 635ce26af..8ff3d0952 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -8938,9 +8938,27 @@ camera_init (Camera *camera, GPContext *context) } /* moved down here in case the filesystem needs to first be initialized as the Olympus app does */ if (params->deviceinfo.VendorExtensionID == PTP_VENDOR_GP_OLYMPUS_OMD) { + unsigned int k; + GP_LOG_D ("Initializing Olympus ... "); ptp_olympus_init_pc_mode(params); + /* try to refetch the storage ids, set before only has 0x00000001 */ + if (params->storageids.n) { + free (params->storageids.Storage); + params->storageids.Storage = NULL; + params->storageids.n = 0; + } + + C_PTP (ptp_getstorageids(params, ¶ms->storageids)); + + /* refetch root */ + for (k=0;k<params->storageids.n;k++) { + if (!(params->storageids.Storage[k] & 0xffff)) continue; + if (params->storageids.Storage[k] == 0x80000001) continue; + ptp_list_folder (params, params->storageids.Storage[k], PTP_HANDLER_SPECIAL); + } + /* if(params->storageids.n > 0) { // Olympus app gets storage info for first item, so emulating here PTPStorageInfo storageinfo; @@ -8964,9 +8982,6 @@ camera_init (Camera *camera, GPContext *context) } */ } - - - SET_CONTEXT(camera, NULL); return GP_OK; } |