mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-05 14:30:03 +01:00
added lock
This commit is contained in:
@@ -1400,8 +1400,10 @@ void AC_MainWindow::setFrameIndex(int index) {
|
||||
frame_index = index;
|
||||
}
|
||||
|
||||
std::mutex mut_lock;
|
||||
|
||||
void AC_MainWindow::updateFrame(QImage img) {
|
||||
mut_lock.lock();
|
||||
if(playback->isStopped() == false) {
|
||||
disp->displayImage(img);
|
||||
//disp2->displayImage(img);
|
||||
@@ -1445,6 +1447,7 @@ void AC_MainWindow::updateFrame(QImage img) {
|
||||
take_snapshot = false;
|
||||
}
|
||||
}
|
||||
mut_lock.unlock();
|
||||
}
|
||||
|
||||
void AC_MainWindow::stopRecording() {
|
||||
|
||||
@@ -345,7 +345,7 @@ void Playback::run() {
|
||||
ac::in_custom = false;
|
||||
drawFilter(frame, current_filter);
|
||||
drawEffects(frame);
|
||||
msleep(duration/2);
|
||||
msleep(duration);
|
||||
mutex.unlock();
|
||||
} else if(cur.size()>0) {
|
||||
mutex.lock();
|
||||
@@ -355,7 +355,7 @@ void Playback::run() {
|
||||
if(i == cur.size()-1)
|
||||
ac::in_custom = false;
|
||||
drawFilter(frame, cur[i]);
|
||||
msleep(duration/2);
|
||||
msleep(duration);
|
||||
}
|
||||
} else {
|
||||
if(_custom_cycle_index > static_cast<int>(cur.size()-1))
|
||||
@@ -363,7 +363,7 @@ void Playback::run() {
|
||||
|
||||
if(_custom_cycle_index >= 0 && _custom_cycle_index < static_cast<int>(cur.size())) {
|
||||
drawFilter(frame, cur[_custom_cycle_index]);
|
||||
msleep(duration/2);
|
||||
msleep(duration);
|
||||
}
|
||||
}
|
||||
drawEffects(frame);
|
||||
|
||||
Reference in New Issue
Block a user