added lock when applying color_map/brighness etc.

This commit is contained in:
lostjared
2018-03-18 04:20:13 -07:00
parent 419208bdf4
commit df5f56b1ae

View File

@@ -150,7 +150,6 @@ void Playback::run() {
for(unsigned int i = 0; i < cur.size(); ++i) { for(unsigned int i = 0; i < cur.size(); ++i) {
if(i == cur.size()-1) if(i == cur.size()-1)
ac::in_custom = false; ac::in_custom = false;
if(cur[i].first == 0) { if(cur[i].first == 0) {
ac::draw_func[cur[i].second](frame); ac::draw_func[cur[i].second](frame);
} else if(cur[i].first == 1) { } else if(cur[i].first == 1) {
@@ -159,6 +158,8 @@ void Playback::run() {
} else if(cur[i].first == 2) { } else if(cur[i].first == 2) {
draw_plugin(frame, cur[i].second); draw_plugin(frame, cur[i].second);
} }
}
mutex.lock();
if(ac::set_color_map > 0) ac::ApplyColorMap(frame); if(ac::set_color_map > 0) ac::ApplyColorMap(frame);
if(bright_ > 0) { if(bright_ > 0) {
ac::setBrightness(frame, 1.0, bright_); ac::setBrightness(frame, 1.0, bright_);
@@ -170,7 +171,7 @@ void Playback::run() {
if(saturation_ > 0) { if(saturation_ > 0) {
ac::setSaturation(frame, saturation_); ac::setSaturation(frame, saturation_);
} }
} mutex.unlock();
} else { } else {
msleep(duration); msleep(duration);
} }