aboutsummaryrefslogtreecommitdiff
path: root/include/MessageQueue.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-29 10:14:53 +0100
committerdec05eba <dec05eba@protonmail.com>2020-10-29 10:14:53 +0100
commita8f1ebca36d90d965e8a55ebc766f659db65b0c1 (patch)
tree6daefa8768e44a7cd21f096821321dd150e42c8d /include/MessageQueue.hpp
parent620123fbd6c18dc48a25cc735565f6d8d85f8639 (diff)
Matrix: download unstreamable videos before playing them (mp4)
Diffstat (limited to 'include/MessageQueue.hpp')
-rw-r--r--include/MessageQueue.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/MessageQueue.hpp b/include/MessageQueue.hpp
index 174a227..df331ac 100644
--- a/include/MessageQueue.hpp
+++ b/include/MessageQueue.hpp
@@ -20,9 +20,9 @@ namespace QuickMedia {
}
std::optional<T> pop_wait() {
+ std::unique_lock<std::mutex> lock(mutex);
if(!running)
return std::nullopt;
- std::unique_lock<std::mutex> lock(mutex);
while(data_queue.empty() && running) cv.wait(lock);
if(!running)
return std::nullopt;