Fix a recording performance issue
This is why dev is a thing
This commit is contained in:
parent
afbe278155
commit
9ef6aa562a
@ -58,13 +58,15 @@ bool Worker::ended() {
|
|||||||
|
|
||||||
void Worker::process() {
|
void Worker::process() {
|
||||||
while (!ended()) {
|
while (!ended()) {
|
||||||
QMutexLocker ml(&lock);
|
lock.lock();
|
||||||
if (!qqueue.isEmpty()) {
|
if (!qqueue.isEmpty()) {
|
||||||
_WorkerContext *c = qqueue.dequeue();
|
_WorkerContext *c = qqueue.dequeue();
|
||||||
|
lock.unlock();
|
||||||
c->consumer(c->image.convertToFormat(c->targetFormat));
|
c->consumer(c->image.convertToFormat(c->targetFormat));
|
||||||
delete c->underlyingThing;
|
delete c->underlyingThing;
|
||||||
delete c;
|
delete c;
|
||||||
}
|
} else
|
||||||
|
lock.unlock();
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(10)); // STL likes it's scopes
|
std::this_thread::sleep_for(std::chrono::milliseconds(10)); // STL likes it's scopes
|
||||||
}
|
}
|
||||||
emit finished();
|
emit finished();
|
||||||
|
Loading…
Reference in New Issue
Block a user