diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c index 7f92bd778..09421b70a 100644 --- a/camlibs/ptp2/ptp-pack.c +++ b/camlibs/ptp2/ptp-pack.c @@ -767,34 +767,36 @@ ptp_unpack_Sony_DPD (PTPParams *params, const unsigned char* data, PTPDeviceProp /* This is a control value and can be set */ /* 0x81 - button, 0x83 - lock, 0x82 - notch, 0x84 - variable */ dpd->GetSet = PTP_DPGS_GetSet; - } - switch (isenabled) { - case 0: /* grayed out */ - dpd->GetSet = PTP_DPGS_Get; /* just to be safe */ - break; - case 1: /* enabled */ - /* enable for sony mode 2 - GetSet is 0 for many settings e.g. iso that *are* settable */ - dpd->GetSet = PTP_DPGS_GetSet; - break; - case 2: /* display only */ - default: - /* Some settings in Sony mode 2 are marked as display only, but can be still be set */ - for (i=0;iDevicePropCode) { + /* isenabled is filled out for some properties and not others, assume all controls writable for now */ + } else { + /* regular property */ + switch (isenabled) { + case 0: /* grayed out */ + dpd->GetSet = PTP_DPGS_Get; /* just to be safe */ + break; + case 1: /* enabled */ + /* enable for sony mode 2 - GetSet is 0 for many settings e.g. iso that *are* settable */ + dpd->GetSet = PTP_DPGS_GetSet; + break; + case 2: /* display only */ + default: + /* Some settings in Sony mode 2 are marked as display only, but can be still be set */ + for (i=0;iDevicePropCode) { + dpd->GetSet = PTP_DPGS_GetSet; + break; + } + } + break; + } + if (dpd->GetSet == PTP_DPGS_Get) { + /* Some settings in Sony mode 2 are marked as disabled, but can be still be set */ + for (i=0;iDevicePropCode) { dpd->GetSet = PTP_DPGS_GetSet; break; } } - break; - } - - if (dpd->GetSet == PTP_DPGS_Get) { - /* Some settings in Sony mode 2 are marked as disabled, but can be still be set */ - for (i=0;iDevicePropCode) { - dpd->GetSet = PTP_DPGS_GetSet; - break; - } } } } else {