Fix double stop in ANSVideoPlayer
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user