diff --git a/app/project/item/item.cpp b/app/project/item/item.cpp index b931dc60a..0105f0f3e 100644 --- a/app/project/item/item.cpp +++ b/app/project/item/item.cpp @@ -120,3 +120,13 @@ bool Item::CanHaveChildren() const { return false; } + +void Item::Lock() +{ + mutex_.lock(); +} + +void Item::Unlock() +{ + mutex_.unlock(); +} diff --git a/app/project/item/item.h b/app/project/item/item.h index b1f00ae81..ef8da3e33 100644 --- a/app/project/item/item.h +++ b/app/project/item/item.h @@ -24,6 +24,7 @@ #include #include #include +#include #include class Item; @@ -96,6 +97,9 @@ public: virtual bool CanHaveChildren() const; + void Lock(); + void Unlock(); + private: QList children_; @@ -107,6 +111,8 @@ private: QString tooltip_; + QMutex mutex_; + }; #endif // ITEM_H diff --git a/app/task/probe/probe.cpp b/app/task/probe/probe.cpp index 744bd8c12..9d6e82a55 100644 --- a/app/task/probe/probe.cpp +++ b/app/task/probe/probe.cpp @@ -34,7 +34,11 @@ ProbeTask::ProbeTask(FootagePtr footage) : bool ProbeTask::Action() { + footage_->Lock(); + olive::ProbeMedia(footage_.get()); + footage_->Unlock(); + return true; }