abstract list fixes
diff --git a/ChangeLog b/ChangeLog
index baa011b..c987e7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-29 Richard Low <[email protected]>
+
+ * src/libmtp.c: Made abstract list creation to be more
+ WMP like
+ * src/libusb-glue.c: added Philips GoGear SA9200
+
2006-12-29 Marcus Meissner <[email protected]>
* src/ptp.h: API changes for libgphoto2 to use the file
diff --git a/src/libmtp.c b/src/libmtp.c
index adac7b1..ceced61 100644
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -3812,14 +3812,8 @@
}
free(props);
- // TODO: try setting size to 0xFFFFFFFFU instead of 1 here, and move
- // the 1-byte sending function below.
- // Playlists created on device have size (uint32_t) -1 = 0xFFFFFFFFU, but setting:
- // new_object.ObjectCompressedSize = 0; <- DOES NOT WORK! (return PTP_RC_GeneralError)
- // new_object.ObjectCompressedSize = (uint32_t) -1; <- DOES NOT WORK!
- // (return PTP_RC_MTP_Object_Too_Large or 0xa809 whatever that is)
ret = ptp_mtp_sendobjectproplist(params, &store, &localph, newid,
- objectformat, 1, proplist);
+ objectformat, 0, proplist);
/* Free property list */
prop = proplist;
@@ -3839,6 +3833,15 @@
}
return -1;
}
+
+ // now send the blank objet
+ ret = ptp_sendobject(params, NULL, 0);
+ if (ret != PTP_RC_OK) {
+ ptp_perror(params, ret);
+ printf("create_new_abstract_list(): Could not send blank object data\n");
+ printf("Return code: 0x%04x (look this up in ptp.h for an explanation).\n", ret);
+ return -1;
+ }
} else if (ptp_operation_issupported(params,PTP_OC_SendObjectInfo)) {
#else // !ENABLE_MTP_ENHANCED
@@ -3862,29 +3865,27 @@
}
return -1;
}
- }
-
- /*
- * We have to send this one blank data byte.
- * If we don't, the handle will not be created and thus there is no playlist.
- * TODO: see if this can be avoided with enhanced commands!
- */
- data[0] = '\0';
- data[1] = '\0';
- ret = ptp_sendobject(params, data, 1);
- if (ret != PTP_RC_OK) {
- ptp_perror(params, ret);
- printf("create_new_abstract_list(): Could not send blank object data\n");
- printf("Return code: 0x%04x (look this up in ptp.h for an explanation).\n", ret);
- return -1;
- }
-
- // Update title
- // TODO: should not be needed for enhanced commands!
- ret = set_object_string(device, *newid, PTP_OPC_Name, name);
- if (ret != 0) {
- printf("create_new_abstract_list(): could not set entity name\n");
- return -1;
+
+ /*
+ * We have to send this one blank data byte.
+ * If we don't, the handle will not be created and thus there is no playlist.
+ */
+ data[0] = '\0';
+ data[1] = '\0';
+ ret = ptp_sendobject(params, data, 1);
+ if (ret != PTP_RC_OK) {
+ ptp_perror(params, ret);
+ printf("create_new_abstract_list(): Could not send blank object data\n");
+ printf("Return code: 0x%04x (look this up in ptp.h for an explanation).\n", ret);
+ return -1;
+ }
+
+ // Update title
+ ret = set_object_string(device, *newid, PTP_OPC_Name, name);
+ if (ret != 0) {
+ printf("create_new_abstract_list(): could not set entity name\n");
+ return -1;
+ }
}
if (no_tracks > 0) {
diff --git a/src/libusb-glue.c b/src/libusb-glue.c
index 6abaa7b..95d01ac 100644
--- a/src/libusb-glue.c
+++ b/src/libusb-glue.c
@@ -118,6 +118,8 @@
{ "Philips HDD1630/17", 0x0471, 0x014c, DEVICE_FLAG_NONE },
// From Gerhard Mekenkamp
{ "Philips GoGear Audio", 0x0471, 0x0165, DEVICE_FLAG_NONE },
+ // from XNJB forum
+ { "Philips GoGear SA9200", 0x0471, 0x014f, DEVICE_FLAG_NONE },
/*
* SanDisk