From 2132e33a20f57b20176df88616968bf60384e672 Mon Sep 17 00:00:00 2001 From: Douglas Deslauriers Date: Fri, 13 Mar 2026 23:49:06 -0400 Subject: [PATCH] Shutdown Sony cameras after PTPIP exits --- camlibs/ptp2/library.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index f31d7665c..fcffe81eb 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -3282,12 +3282,13 @@ camera_exit (Camera *camera, GPContext *context) } break; case PTP_VENDOR_SONY: -#if 0 - /* if we call this, the camera shuts down on close in MTP mode */ - if (ptp_operation_issupported(params, 0x9280)) { - C_PTP (ptp_sony_9280(params, 0x4,0,5,0,0,0,0)); + /* Sony cameras expect to be issued this shutdown command after any + * operation in PTPIP mode. */ + if (camera->port->type == GP_PORT_PTPIP) { + if (ptp_operation_issupported(params, 0x9280)) { + C_PTP (ptp_sony_9280(params, 0x4,0,5,0,0,0,0)); + } } -#endif break; case PTP_VENDOR_FUJI: CR (camera_unprepare_capture (camera, context));