Commit 8f98f62c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

VLCThumbnailer: Reduce useless locking

parent b93d7f70
......@@ -206,10 +206,9 @@ void VLCThumbnailer::setupVout( VLC::MediaPlayer& mp )
},
//unlock
[this](void*, void*const*) {
std::unique_lock<std::mutex> lock(m_mutex);
if ( m_snapshotRequired == true )
bool expected = true;
if ( m_snapshotRequired.compare_exchange_strong( expected, false ) )
{
m_snapshotRequired = false;
m_cond.notify_all();
}
}
......
......@@ -64,6 +64,6 @@ private:
std::unique_ptr<Evas, void(*)(Evas*)> m_canvas;
#endif
std::unique_ptr<uint8_t[]> m_buff;
bool m_snapshotRequired;
std::atomic_bool m_snapshotRequired;
uint32_t m_height;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment