if no filter selected run at correct speed

This commit is contained in:
lostjared
2017-03-01 18:09:02 -08:00
parent 99c5cb5adf
commit fcb8b60370
2 changed files with 5 additions and 4 deletions

View File

@@ -26,7 +26,6 @@ void generate_map() {
filter_map[filter_n] = std::make_pair(1, index);
++index;
}
for(unsigned int j = 0; j < plugins.plugin_list.size(); ++j) {
std::string name = "plugin " + plugins.plugin_list[j]->name();
filter_map[name] = std::make_pair(2, j);
@@ -227,7 +226,6 @@ void AC_MainWindow::cb_SetIndex(int index) {
}
void AC_MainWindow::addClicked() {
int row = filters->currentRow();
if(row != -1) {
QListWidgetItem *item = filters->item(row);
@@ -253,7 +251,6 @@ void AC_MainWindow::rmvClicked() {
std::vector<std::pair<int, int>> v;
buildVector(v);
playback->setVector(v);
}
}
@@ -266,7 +263,6 @@ void AC_MainWindow::upClicked() {
std::vector<std::pair<int, int>> v;
buildVector(v);
playback->setVector(v);
}
}

View File

@@ -49,6 +49,9 @@ void Playback::setDisplayed(bool shown) {
}
void Playback::run() {
int duration = 1000/ac::fps;
while(!stop) {
mutex.lock();
if(!capture.read(frame)) {
@@ -78,6 +81,8 @@ void Playback::run() {
draw_plugin(frame, cur[i].second);
}
}
} else {
msleep(duration);
}
mutex.lock();
if(recording && writer.isOpened()) {