rendermanager: always create tickets in own thread
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user