summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyihong Chae <hh.chae@samsung.com>2016-04-04 20:27:29 +0900
committerHyihong Chae <hh.chae@samsung.com>2016-04-04 20:32:11 +0900
commitee6b4e3a33804967b71c3749f54cd475440cb8d7 (patch)
tree018e2d416397e0a1c0e9645e05af8e69528b9a30
parent58b91f75a8da837d5796740b5b9997f01905b64c (diff)
downloadlibmtp-accepted/tizen/ivi/20160405.083025.tar.gz
libmtp-accepted/tizen/ivi/20160405.083025.tar.bz2
libmtp-accepted/tizen/ivi/20160405.083025.zip
Change-Id: I1056a7934c704812e4cee1cb1f61d46ef6373697 Signed-off-by: HyiHong Chae <hh.chae@samsung.com>
-rwxr-xr-xexamples/albumart.c11
-rwxr-xr-xexamples/detect.c2
-rwxr-xr-xexamples/thumb.c11
-rwxr-xr-xpackaging/libmtp.spec2
-rwxr-xr-xsrc/libmtp.c6
-rwxr-xr-xsrc/libusb1-glue.c19
-rwxr-xr-xsrc/ptp.c3
7 files changed, 50 insertions, 4 deletions
diff --git a/examples/albumart.c b/examples/albumart.c
index c98b305..6536ea4 100755
--- a/examples/albumart.c
+++ b/examples/albumart.c
@@ -124,8 +124,19 @@ int main (int argc, char **argv) {
return 1;
}
else {
+#ifdef TIZEN_EXT
+ int rv;
+ rv = read(fd, imagedata, filesize);
+ close(fd);
+
+ if (rv < 0) {
+ printf("Read fail.\n");
+ return 0;
+ }
+#else /* TIZEN_EXT */
read(fd, imagedata, filesize);
close(fd);
+#endif /* TIZEN_EXT */
}
LIBMTP_Init();
diff --git a/examples/detect.c b/examples/detect.c
index 92e43b8..e155708 100755
--- a/examples/detect.c
+++ b/examples/detect.c
@@ -134,7 +134,9 @@ int main (int argc, char **argv)
char *friendlyname;
char *syncpartner;
char *sectime;
+#ifndef TIZEN_EXT
char *devcert;
+#endif /* TIZEN_EXT */
uint16_t *filetypes;
uint16_t filetypes_len;
uint8_t maxbattlevel;
diff --git a/examples/thumb.c b/examples/thumb.c
index 2718a0c..03f8983 100755
--- a/examples/thumb.c
+++ b/examples/thumb.c
@@ -93,8 +93,19 @@ int main (int argc, char **argv) {
return 1;
}
else {
+#ifdef TIZEN_EXT
+ int rv;
+ rv = read(fd, imagedata, filesize);
+ close(fd);
+
+ if (rv < 0) {
+ printf("Read fail.\n");
+ return 0;
+ }
+#else /* TIZEN_EXT */
read(fd, imagedata, filesize);
close(fd);
+#endif /* TIZEN_EXT */
}
LIBMTP_Init();
diff --git a/packaging/libmtp.spec b/packaging/libmtp.spec
index 9deaef7..a28e197 100755
--- a/packaging/libmtp.spec
+++ b/packaging/libmtp.spec
@@ -3,7 +3,7 @@
Name: libmtp
Summary: Library for media transfer protocol (mtp)
Version: 1.1.9
-Release: 11
+Release: 12
Group: Network & Connectivity/Other
License: LGPL-2.1
Source0: libmtp-%{version}.tar.gz
diff --git a/src/libmtp.c b/src/libmtp.c
index ab6797a..10bd30f 100755
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -214,6 +214,10 @@ static int set_object_filename(LIBMTP_mtpdevice_t *device,
static char *generate_unique_filename(PTPParams* params, char const * const filename);
static int check_filename_exists(PTPParams* params, char const * const filename);
+#ifdef TIZEN_EXT
+int _is_exist_handler(uint32_t **object_list, int size, int current_handler);
+#endif /* TIZEN_EXT */
+
/**
* These are to wrap the get/put handlers to convert from the MTP types to PTP types
* in a reliable way
@@ -9234,7 +9238,7 @@ static void update_metadata_cache(LIBMTP_mtpdevice_t *device, uint32_t object_id
}
#ifdef TIZEN_EXT
-int _is_exist_handler(int **object_list, int size, int current_handler)
+int _is_exist_handler(uint32_t **object_list, int size, int current_handler)
{
int i;
diff --git a/src/libusb1-glue.c b/src/libusb1-glue.c
index e187420..e2fd45b 100755
--- a/src/libusb1-glue.c
+++ b/src/libusb1-glue.c
@@ -865,8 +865,8 @@ ptp_read_func (
unsigned char *bytes;
int expect_terminator_byte = 0;
unsigned long usb_inep_maxpacket_size;
- unsigned long context_block_size_1;
- unsigned long context_block_size_2;
+ unsigned long context_block_size_1 = 0;
+ unsigned long context_block_size_2 = 0;
uint16_t ptp_dev_vendor_id = ptp_usb->rawdevice.device_entry.vendor_id;
//"iRiver" device special handling
@@ -2100,6 +2100,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
if (err) {
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
LIBMTP_ERROR("LIBMTP PANIC: Unable to find interface & endpoints of device\n");
return LIBMTP_ERROR_CONNECTING;
}
@@ -2111,6 +2114,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
if (init_ptp_usb(params, ptp_usb, ldevice) < 0) {
LIBMTP_ERROR("LIBMTP PANIC: Unable to initialize device\n");
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
return LIBMTP_ERROR_CONNECTING;
}
@@ -2127,6 +2133,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
if(init_ptp_usb(params, ptp_usb, ldevice) <0) {
LIBMTP_ERROR("LIBMTP PANIC: Could not init USB on second attempt\n");
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
return LIBMTP_ERROR_CONNECTING;
}
@@ -2134,6 +2143,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
if ((ret = ptp_opensession(params, 1)) == PTP_ERROR_IO) {
LIBMTP_ERROR("LIBMTP PANIC: failed to open session on second attempt\n");
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
return LIBMTP_ERROR_CONNECTING;
}
}
@@ -2151,6 +2163,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
ret);
libusb_release_interface(ptp_usb->handle, ptp_usb->interface);
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
return LIBMTP_ERROR_CONNECTING;
}
diff --git a/src/ptp.c b/src/ptp.c
index 159b243..0f904a9 100755
--- a/src/ptp.c
+++ b/src/ptp.c
@@ -22,7 +22,10 @@
* Boston, MA 02110-1301 USA
*/
+#ifndef TIZEN_EXT
#define _BSD_SOURCE
+#endif /* TIZEN_EXT */
+
#include "config.h"
#include "ptp.h"