Skip to content

Commit

Permalink
plugins/videostream/VideoStream: Protecting reading from a closed str…
Browse files Browse the repository at this point in the history
…eam.
  • Loading branch information
paulosousadias committed Nov 14, 2023
1 parent 8fe9497 commit 9de92cf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -544,6 +544,8 @@ public void actionPerformed(ActionEvent e) {
NeptusLog.pub().info("Closing video streams");
noVideoLogoState = false;
isCleanTurnOffCam = true;
state = false;
ipCam = false;
if (capture != null && capture.isOpened()) {
try {
capture.release();
@@ -552,8 +554,6 @@ public void actionPerformed(ActionEvent e) {
NeptusLog.pub().error(exp.getMessage());
}
}
state = false;
ipCam = false;
repaint(500);
}
});
@@ -1183,7 +1183,7 @@ else if (ipCam && state) {
long startTime = System.currentTimeMillis();
isAliveIPCam = false;
resetWatchDog(4000);
while (watchDog.isAlive() && !isAliveIPCam) {
while (watchDog.isAlive() && !isAliveIPCam && capture != null && capture.isOpened()) {
try {
capture.read(mat);
isAliveIPCam = true;

0 comments on commit 9de92cf

Please sign in to comment.