diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2020-05-18 09:10:17 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2020-05-18 09:10:17 +0200 |
commit | 1f029549f042b4234cc01ca526e8e0134c1ddcc6 (patch) | |
tree | ecdc46c690ff0d98f0f8914f2ce840ee4e3ea7b9 | |
parent | ed6a190593a41f765ddfba4227d588522fe9dd1c (diff) | |
download | libgphoto2-1f029549f042b4234cc01ca526e8e0134c1ddcc6.tar.gz |
do not overwrite output variables for EVFOutput camera output.
-rw-r--r-- | camlibs/ptp2/library.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index c9bdf91b4..a600f07c7 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -3038,7 +3038,9 @@ camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context) ptp_free_devicepropdesc (&dpd); /* do not set it everytime, it will cause delays */ ret = ptp_canon_eos_getdevicepropdesc (params, PTP_DPC_CANON_EOS_EVFOutputDevice, &dpd); - if ((ret == PTP_RC_OK) && (dpd.CurrentValue.u32 != 2)) { + /* see config.c what kind of values we have ... it seems to be a mask. bit 0 is TFT, bit 1 PC, bit 2 MOBILE, bit 3 MOBILE2? */ + /* so lets see it only if it does not have any bit set (discounted bit 0) */ + if ((ret == PTP_RC_OK) && ((dpd.CurrentValue.u32 & ~1) == 0)) { /* 2 means PC, 1 means TFT */ val.u32 = 2; C_PTP_MSG (ptp_canon_eos_setdevicepropvalue (params, PTP_DPC_CANON_EOS_EVFOutputDevice, &val, PTP_DTC_UINT32), |