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