rendermanager: always create tickets in own thread

This commit is contained in:
itsmattkc
2020-11-28 21:27:35 +11:00
parent 73aa3760f3
commit d9e445d39e
+12
View File
@@ -145,6 +145,10 @@ RenderTicketPtr RenderManager::RenderFrame(ViewerOutput* viewer, ColorManager* c
ticket->setProperty("cache", cache->GetCacheDirectory());
}
if (ticket->thread() != this->thread()) {
ticket->moveToThread(this->thread());
}
// Queue appending the ticket and running the next job on our thread to make this function thread-safe
QMetaObject::invokeMethod(this, "AddTicket", Qt::AutoConnection,
OLIVE_NS_ARG(RenderTicketPtr, ticket),
@@ -169,6 +173,10 @@ RenderTicketPtr RenderManager::RenderAudio(ViewerOutput* viewer, const TimeRange
ticket->setProperty("waveforms", generate_waveforms);
ticket->setProperty("aparam", QVariant::fromValue(params));
if (ticket->thread() != this->thread()) {
ticket->moveToThread(this->thread());
}
// Queue appending the ticket and running the next job on our thread to make this function thread-safe
QMetaObject::invokeMethod(this, "AddTicket", Qt::AutoConnection,
OLIVE_NS_ARG(RenderTicketPtr, ticket),
@@ -187,6 +195,10 @@ RenderTicketPtr RenderManager::SaveFrameToCache(FrameHashCache *cache, FramePtr
ticket->setProperty("hash", hash);
ticket->setProperty("type", kTypeVideoDownload);
if (ticket->thread() != this->thread()) {
ticket->moveToThread(this->thread());
}
// Queue appending the ticket and running the next job on our thread to make this function thread-safe
QMetaObject::invokeMethod(this, "AddTicket", Qt::AutoConnection,
OLIVE_NS_ARG(RenderTicketPtr, ticket),