summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Jung <jh8801.jung@samsung.com>2022-10-07 14:26:20 +0900
committerJihoon Jung <jh8801.jung@samsung.com>2022-10-07 14:27:48 +0900
commite2c7c3900f8b7f33ad5bb8b50befbefc1377de72 (patch)
treea9471ae8f6771f9aa63aacb68398edd5d039c987
parentd6f865c5af17f3401a9825b16146f6a198e3d7d6 (diff)
downloadlibmtp-tizen_7.0_hotfix.tar.gz
libmtp-tizen_7.0_hotfix.tar.bz2
libmtp-tizen_7.0_hotfix.zip
Change-Id: I99e706148b06788127c858c7d74f198c64d054e8 Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
-rw-r--r--[-rwxr-xr-x]packaging/libmtp.spec2
-rw-r--r--[-rwxr-xr-x]src/libmtp.c25
2 files changed, 22 insertions, 5 deletions
diff --git a/packaging/libmtp.spec b/packaging/libmtp.spec
index ad03958..7558ea4 100755..100644
--- a/packaging/libmtp.spec
+++ b/packaging/libmtp.spec
@@ -3,7 +3,7 @@
Name: libmtp
Summary: Library for media transfer protocol (mtp)
Version: 1.1.11
-Release: 14
+Release: 15
Group: Network & Connectivity/Other
License: LGPL-2.1
Source0: libmtp-%{version}.tar.gz
diff --git a/src/libmtp.c b/src/libmtp.c
index 1b0d6a0..859c99c 100755..100644
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -1695,7 +1695,7 @@ LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void)
if (devices == NULL) {
return NULL;
}
-
+
if (numdevs == 0) {
if (devices) {
free(devices);
@@ -8987,19 +8987,36 @@ int LIBMTP_Get_Representative_Sample(LIBMTP_mtpdevice_t *device,
int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *device, uint32_t const id,
unsigned char **data, unsigned int *size)
{
+ LIBMTP_INFO("LIBMTP_Get_Thumbnail start");
PTPParams *params = (PTPParams *) device->params;
uint16_t ret;
+ PTP_USB *ptp_usb = (PTP_USB*) device->usbinfo;
+
+ int oldtimeout;
+
+ get_usb_device_timeout(ptp_usb, &oldtimeout);
+ set_usb_device_timeout(ptp_usb, 3000);
+
+ LIBMTP_INFO("priv set timeout value : %d, now, set timeout value to 3 sec", oldtimeout);
+
ret = ptp_getthumb(params, id, data, size);
- if (ret == PTP_RC_OK)
- return 0;
- return -1;
+ if (ret != PTP_RC_OK) {
+ LIBMTP_INFO("ptp_getthumb failed : %d", ret);
+ set_usb_device_timeout(ptp_usb, oldtimeout);
+ return -1;
+ }
+
+ set_usb_device_timeout(ptp_usb, oldtimeout);
+ LIBMTP_INFO("LIBMTP_Get_Thumbnail end");
+ return 0;
}
#ifdef TIZEN_EXT
int LIBMTP_Get_Thumbnail_From_Exif_Data(LIBMTP_mtpdevice_t *device, uint32_t const id,
unsigned char **data, unsigned int *size)
{
+ LIBMTP_INFO("LIBMTP_Get_Thumbnail_From_Exif_Data start");
PTPParams *params = (PTPParams *) device->params;
uint16_t ret;