Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: patches/02_check_ptp_operation_support.patch

Issue 2364793002: Revert "Uprev libmtp to 1.1.12" (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libmtp@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « patches/01_build_fixes.patch ('k') | patches/03_enable_ptp_support.patch » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Index: src/libmtp.c
2 ===================================================================
3 --- src/libmtp.c (revision 148597)
4 +++ src/libmtp.c (working copy)
5 @@ -1144,6 +1144,9 @@
6 int supported = 0;
7 uint16_t ptp_prop = map_libmtp_property_to_ptp_property(property);
8
9 + if (!ptp_operation_issupported(device->params, PTP_OC_MTP_GetObjectPropsSuppo rted))
10 + return 0;
11 +
12 ret = ptp_mtp_getobjectpropssupported(device->params, map_libmtp_type_to_ptp_ type(filetype), &propcnt, &props);
13 if (ret != PTP_RC_OK) {
14 add_ptp_error_to_errorstack(device, ret, "LIBMTP_Is_Property_Supported(): c ould not get properties supported.");
15 @@ -1974,40 +1977,42 @@
16 }
17
18 /* Determine if the object size supported is 32 or 64 bit wide */
19 - for (i=0;i<current_params->deviceinfo.ImageFormats_len;i++) {
20 - PTPObjectPropDesc opd;
21 + if (ptp_operation_issupported(current_params,PTP_OC_MTP_GetObjectPropsSupport ed)) {
22 + for (i=0;i<current_params->deviceinfo.ImageFormats_len;i++) {
23 + PTPObjectPropDesc opd;
24
25 - if (ptp_mtp_getobjectpropdesc(current_params,
26 - PTP_OPC_ObjectSize,
27 - current_params->deviceinfo.ImageFormats[i],
28 - &opd) != PTP_RC_OK) {
29 - LIBMTP_ERROR("LIBMTP PANIC: "
30 - "could not inspect object property descriptions!\n");
31 - } else {
32 - if (opd.DataType == PTP_DTC_UINT32) {
33 - if (bs == 0) {
34 - bs = 32;
35 - } else if (bs != 32) {
36 - LIBMTP_ERROR("LIBMTP PANIC: "
37 - "different objects support different object sizes!\n");
38 - bs = 0;
39 - break;
40 - }
41 - } else if (opd.DataType == PTP_DTC_UINT64) {
42 - if (bs == 0) {
43 - bs = 64;
44 - } else if (bs != 64) {
45 - LIBMTP_ERROR("LIBMTP PANIC: "
46 - "different objects support different object sizes!\n");
47 - bs = 0;
48 - break;
49 - }
50 + if (ptp_mtp_getobjectpropdesc(current_params,
51 + PTP_OPC_ObjectSize,
52 + current_params->deviceinfo.ImageFormats[i],
53 + &opd) != PTP_RC_OK) {
54 + LIBMTP_ERROR("LIBMTP PANIC: "
55 + "could not inspect object property descriptions!\n");
56 } else {
57 - // Ignore if other size.
58 - LIBMTP_ERROR("LIBMTP PANIC: "
59 - "awkward object size data type: %04x\n", opd.DataType);
60 - bs = 0;
61 - break;
62 + if (opd.DataType == PTP_DTC_UINT32) {
63 + if (bs == 0) {
64 + bs = 32;
65 + } else if (bs != 32) {
66 + LIBMTP_ERROR("LIBMTP PANIC: "
67 + "different objects support different object sizes!\n") ;
68 + bs = 0;
69 + break;
70 + }
71 + } else if (opd.DataType == PTP_DTC_UINT64) {
72 + if (bs == 0) {
73 + bs = 64;
74 + } else if (bs != 64) {
75 + LIBMTP_ERROR("LIBMTP PANIC: "
76 + "different objects support different object sizes!\n") ;
77 + bs = 0;
78 + break;
79 + }
80 + } else {
81 + // Ignore if other size.
82 + LIBMTP_ERROR("LIBMTP PANIC: "
83 + "awkward object size data type: %04x\n", opd.DataType);
84 + bs = 0;
85 + break;
86 + }
87 }
88 }
89 }
90 @@ -4107,7 +4112,7 @@
91 break;
92 }
93 }
94 - } else {
95 + } else if (ptp_operation_issupported(params,PTP_OC_MTP_GetObjectPropsSupporte d)) {
96 uint16_t *props = NULL;
97 uint32_t propcnt = 0;
98 int ret;
OLDNEW
« no previous file with comments | « patches/01_build_fixes.patch ('k') | patches/03_enable_ptp_support.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698