From dc40e20d667e93347c2e7a90e3aef3503f73fbb2 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 24 May 2020 18:01:24 +0200 Subject: [PATCH] wait_for_event always used 65 seconds timeout for Olympus ... not the passed in timeout. fixes https://github.com/gphoto/gphoto2/issues/305 also helps https://github.com/gphoto/gphoto2/issues/310 --- camlibs/ptp2/library.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index a76665f35..c9bf7f1c9 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -6197,11 +6197,13 @@ sonyout: sprintf (*eventdata, "PTP Property %04x changed to 0x%08x", event.Param1, event.Param2); return GP_OK; default: - GP_LOG_D ("unexpected unhandled event Code %04x, Param 1 %08x", event.Code, event.Param1); - break; + *eventtype = GP_EVENT_UNKNOWN; + C_MEM (*eventdata = malloc(strlen("PTP Event 0123, Param1 01234567")+1)); + sprintf (*eventdata, "PTP Event %04x, Param1 %08x", event.Code, event.Param1); + return GP_OK; } } - } while (waiting_for_timeout (&back_off_wait, event_start, 65000)); /* wait for 65 seconds after busy is no longer signaled */ + } while (waiting_for_timeout (&back_off_wait, event_start, timeout)); downloadomdfile: C_MEM (path = malloc(sizeof(CameraFilePath)));