You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Large performance regression fixed by moving mutex further into the Timeline::GetFrame method - only when generating a new frame (allowing cache to actually work freely). Adding mutex back to FFmpegReader::GetFrame. Removing redundant mutex from ReaderBase.h. Adding mutex to all methods that call shrink_to_fit().
This commit is contained in:
@@ -84,6 +84,9 @@ void FrameMapper::AddField(Field field)
|
||||
|
||||
// Clear both the fields & frames lists
|
||||
void FrameMapper::Clear() {
|
||||
// Prevent async calls to the following code
|
||||
const std::lock_guard<std::recursive_mutex> lock(getFrameMutex);
|
||||
|
||||
// Clear the fields & frames lists
|
||||
fields.clear();
|
||||
fields.shrink_to_fit();
|
||||
@@ -104,6 +107,9 @@ void FrameMapper::Init()
|
||||
// Skip initialization
|
||||
return;
|
||||
|
||||
// Prevent async calls to the following code
|
||||
const std::lock_guard<std::recursive_mutex> lock(getFrameMutex);
|
||||
|
||||
// Clear the fields & frames lists
|
||||
Clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user