Fix double stop in ANSVideoPlayer

This commit is contained in:
2026-04-22 10:10:16 +10:00
parent 97d814936d
commit 57cc8e0a56
14 changed files with 492 additions and 70 deletions

View File

@@ -57,8 +57,11 @@ namespace ANSCENTER {
_logger.LogError("ANSFILEPLAYER::Destroy.", "Unknown exception", __FILE__, __LINE__);
}
}
// Destructor calls close() exactly once — do not call close() explicitly
// beforehand. CFilePlayer::close() is not safe to call twice (it re-enters
// decoder Stop/flush on an already-torn-down decoder).
if (clientToClose) {
clientToClose->close();
clientToClose.reset();
}
}
void ANSFILEPLAYER::CheckLicense() {
@@ -102,7 +105,8 @@ namespace ANSCENTER {
std::lock_guard<std::recursive_mutex> lock(_mutex);
_isPlaying = false;
}
_playerClient->close();
// CFilePlayer::open() calls close() internally at the top — no need
// to close explicitly here (doing so would double-close the decoder).
std::lock_guard<std::recursive_mutex> lock(_mutex);
Setup();
return Start();