summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2020-02-02 12:57:44 +0100
committerMarcus Meissner <marcus@jet.franken.de>2020-02-02 12:58:17 +0100
commit9980bc1fee93d6aa3ccd406bb9b15bd54c0f0255 (patch)
tree59e49d46dae0ba4c1e4da48cf553d8042d4a922c
parent95d726f760251be708246a8cfc4f48351b78edad (diff)
downloadlibgphoto2-9980bc1fee93d6aa3ccd406bb9b15bd54c0f0255.tar.gz
added fix for GoPro files not appearing caused by another hack for another device
-rw-r--r--NEWS1
-rw-r--r--camlibs/ptp2/ptp.c10
2 files changed, 8 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 8c5a6c7d1..272ecb653 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ ptp2:
* Nikon DSLR: fixed a regression where 5 seconds was longer image capture shutterspeed
* Sony: adjusted manualfocusing not to autofocus
* bugfixes
+* GoPro: fixed files not appearing
* New ids added:
* Sony Alpha RX100V, A7s, RX0 II,
* Nikon Z50, Coolpix L810, KeyMission 170
diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c
index 90fc6b338..2f933bf85 100644
--- a/camlibs/ptp2/ptp.c
+++ b/camlibs/ptp2/ptp.c
@@ -7621,9 +7621,13 @@ ptp_object_want (PTPParams *params, uint32_t handle, unsigned int want, PTPObjec
ob->oi.ParentObject = 0;
/* Apple iOS X does that for the root folder. */
- if (ob->oi.ParentObject == ob->oi.StorageID) {
- ptp_debug (params, "parent %08x of %s has same id as storage id. rewriting to 0.", ob->oi.ParentObject, ob->oi.Filename);
- ob->oi.ParentObject = 0;
+ if ((ob->oi.ParentObject == ob->oi.StorageID)) {
+ PTPObject *parentob;
+
+ if (ptp_object_find (params, ob->oi.ParentObject, &parentob) != PTP_RC_OK) {
+ ptp_debug (params, "parent %08x of %s has same id as storage id. and no object found ... rewriting to 0.", ob->oi.ParentObject, ob->oi.Filename);
+ ob->oi.ParentObject = 0;
+ }
}
/* Read out the canon special flags */