Fix double stops

This commit is contained in:
2026-04-22 10:19:03 +10:00
parent 57cc8e0a56
commit 0e203eef99
6 changed files with 33 additions and 14 deletions

View File

@@ -59,8 +59,11 @@ namespace ANSCENTER {
}
clientToClose = std::move(_playerClient);
}
// reset() runs the destructor which calls close() exactly once.
// Do NOT call close() explicitly before reset() — second close would
// re-enter decoder Stop/flush on already-torn-down state.
if (clientToClose) {
clientToClose->close();
clientToClose.reset();
}
}
static void VerifyGlobalANSMJPEGLicense(const std::string& licenseKey) {
@@ -141,7 +144,8 @@ namespace ANSCENTER {
std::lock_guard<std::recursive_mutex> lock(_mutex);
_isPlaying = false;
}
_playerClient->close();
// CHttpMjpegPlayer::open() calls close() internally at the top —
// no need to close explicitly (would be a double-close).
std::lock_guard<std::recursive_mutex> lock(_mutex);
Setup();
_isPlaying = _playerClient->play();