mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-17 04:10:01 +01:00
worked on fixing the issue on windows where the program would freeze when recording then exiting
This commit is contained in:
@@ -122,11 +122,15 @@ void Playback::run() {
|
||||
}
|
||||
|
||||
Playback::~Playback() {
|
||||
mutex.lock();
|
||||
mutex.lock();
|
||||
stop = true;
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
condition.wakeOne();
|
||||
mutex.unlock();
|
||||
#endif
|
||||
mutex.unlock();
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
wait();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Playback::Stop() {
|
||||
@@ -137,12 +141,6 @@ void Playback::Stop() {
|
||||
|
||||
void Playback::Release() {
|
||||
|
||||
if(capture.isOpened()) {
|
||||
capture.release();
|
||||
}
|
||||
if(writer.isOpened()) {
|
||||
writer.release();
|
||||
}
|
||||
}
|
||||
|
||||
void Playback::msleep(int ms) {
|
||||
@@ -193,6 +191,9 @@ void DisplayWindow::paintEvent(QPaintEvent *) {
|
||||
|
||||
|
||||
AC_MainWindow::~AC_MainWindow() {
|
||||
|
||||
controls_Stop();
|
||||
|
||||
delete playback;
|
||||
}
|
||||
AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
|
||||
@@ -559,8 +560,8 @@ bool AC_MainWindow::startVideo(const QString &filename, const QString &outdir, b
|
||||
void AC_MainWindow::controls_Stop() {
|
||||
playback->Stop();
|
||||
if(capture_video.isOpened()) {
|
||||
//capture_video.release();
|
||||
//if(recording == true) writer.release();
|
||||
capture_video.release();
|
||||
if(recording == true) writer.release();
|
||||
cv::destroyWindow("Acid Cam v2");
|
||||
file_new_capture->setEnabled(true);
|
||||
file_new_video->setEnabled(true);
|
||||
@@ -574,8 +575,8 @@ void AC_MainWindow::controls_Stop() {
|
||||
playback->Release();
|
||||
}
|
||||
if(capture_camera.isOpened()) {
|
||||
// capture_camera.release();
|
||||
// if(recording == true) writer.release();
|
||||
capture_camera.release();
|
||||
if(recording == true) writer.release();
|
||||
cv::destroyWindow("Acid Cam v2");
|
||||
file_new_capture->setEnabled(true);
|
||||
file_new_video->setEnabled(true);
|
||||
|
||||
Reference in New Issue
Block a user