From cf52c81dcd98afa11e0e6edf8bd74b2c3438578c Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Wed, 16 Sep 2026 18:44:06 +0800 Subject: [PATCH] fix: stop the correct media controller --- src/slic3r/GUI/MediaPlayCtrl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index 148cff9a8e..b21267edfe 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -554,8 +554,7 @@ void MediaPlayCtrl::StopWebStream() void MediaPlayCtrl::Stop(wxString const &msg, wxString const &msg2) { - const bool webrtc_active = m_webrtc_ctrl && (m_last_mode == CameraStreamMode::webrtc || - current_mode() == CameraStreamMode::webrtc); + const bool webrtc_active = m_webrtc_ctrl && m_last_mode == CameraStreamMode::webrtc; BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::Stop: last_state=" << m_last_state << " webrtc_active=" << webrtc_active << " failed_code=" << m_failed_code << " msg='" << msg.ToUTF8().data() << "'"; @@ -565,11 +564,11 @@ void MediaPlayCtrl::Stop(wxString const &msg, wxString const &msg2) m_media_ctrl->EndExternalStream(); m_webrtc_stopping = false; } - switch (current_mode()) { + switch (m_last_mode) { case CameraStreamMode::http: case CameraStreamMode::https: case CameraStreamMode::http_snapshot: { - const bool snapshot = current_mode() == CameraStreamMode::http_snapshot; + const bool snapshot = m_last_mode == CameraStreamMode::http_snapshot; if (m_last_state != MEDIASTATE_IDLE) { if (snapshot) { if (m_web_ctrl) m_web_ctrl->Stop();