mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
The video decoding thread efficiently waits for a video to be created before doing anything, rather than sleeping for 2ms in a loop. Reduces the CPU usage of the video worker thread to ~0% when no videos are loaded.
This commit is contained in:
@@ -68,10 +68,13 @@ public:
|
||||
void stop();
|
||||
|
||||
private:
|
||||
std::vector<StrongRef<VideoStream>> streams;
|
||||
love::thread::MutexRef mutex;
|
||||
|
||||
volatile bool stopping;
|
||||
std::vector<StrongRef<VideoStream>> streams;
|
||||
|
||||
love::thread::MutexRef mutex;
|
||||
love::thread::ConditionalRef cond;
|
||||
|
||||
bool stopping;
|
||||
}; // Worker
|
||||
|
||||
} // theora
|
||||
|
||||
Reference in New Issue
Block a user