render: use single base thread for rendering

This commit is contained in:
itsmattkc
2022-06-21 14:08:29 -07:00
parent de31f3351a
commit 3f8001b146
5 changed files with 44 additions and 10 deletions
+6 -2
View File
@@ -838,7 +838,7 @@ AVFramePtr FFmpegDecoder::RetrieveFrame(const rational& time, const QAtomicInt *
} else {
// Cut down to thread count - 1 before we acquire a new frame
if (cached_frames_.size() == size_t(MaximumQueueSize())) {
if (cached_frames_.size() > size_t(MaximumQueueSize())) {
RemoveFirstFrame();
}
@@ -1041,7 +1041,11 @@ void FFmpegDecoder::RemoveFirstFrame()
int FFmpegDecoder::MaximumQueueSize()
{
return QThread::idealThreadCount();
// Fairly arbitrary size. This used to need to be the number of current threads to ensure any
// thread that arrived would have its frame available, but if we only have one render thread,
// that's no longer a concern. Now, this value could technically be 1, but some memory cache
// may be useful for reversing. This value may be tweaked over time.
return 2;
}
FFmpegDecoder::Instance::Instance() :