Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix webcam sources failing to stop when opening saved projects #686

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ public void onSourceRemovedEvent(SourceRemovedEvent event) throws InterruptedExc
TimeoutException, IOException {
if (event.getSource() == this) {
try {
this.stopAsync();
// Stop the camera service and wait for it to terminate.
// If we just use stopAsync(), the camera service won't always have terminated by the time
// a new camera source is added. For webcam sources, this means that the video stream
// won't be freed and new sources won't be able to connect to the webcam until the
// application is closed.
this.stopAndAwait();
} finally {
this.eventBus.unregister(this);
}
Expand Down