Guest User

Untitled

a guest
Feb 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. --- library.c.orig 2017-09-16 18:38:42.000000000 +0300
  2. +++ library.c 2018-02-05 21:18:34.540275511 +0300
  3. @@ -3431,10 +3431,28 @@
  4. C_PTP_REP_MSG (ptp_canon_eos_remotereleaseoff (params, 1), _("Canon EOS Half-Release failed"));
  5. } else {
  6. /* Canon EOS M series */
  7. + int button, eos_m_af_success = 0;
  8. +
  9. C_PTP_REP_MSG (ptp_canon_eos_remotereleaseon (params, 3, 0), _("Canon EOS M Full-Press failed"));
  10. - /* full release now */
  11. + /* check if the capture was successful (the result is reported as a set of OLCInfoChanged events) */
  12. + ptp_check_eos_events (params);
  13. + while (ptp_get_one_eos_event (params, &entry)) {
  14. + GP_LOG_D ("entry type %04x", entry.type);
  15. + if (entry.type == PTP_CANON_EOS_CHANGES_TYPE_UNKNOWN && sscanf (entry.u.info, "Button %d", &button)) {
  16. + if (button == 4) {
  17. + eos_m_af_success = 1;
  18. + } else {
  19. + eos_m_af_success = 0;
  20. + gp_context_error (context, _("Canon EOS Capture failed: Perhaps no focus?"));
  21. + }
  22. + break;
  23. + }
  24. + }
  25. + /* full release now (even if the press has failed) */
  26. C_PTP_REP_MSG (ptp_canon_eos_remotereleaseoff (params, 3), _("Canon EOS M Full-Release failed"));
  27. ptp_check_eos_events (params);
  28. + if (!eos_m_af_success)
  29. + return GP_ERROR;
  30. }
  31. } else {
  32. C_PTP_REP_MSG (ptp_canon_eos_capture (params, &result),
Add Comment
Please, Sign In to add comment