From 7b32e75002145a22a0bbf0da5de70b54f97ca005 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 1 Jun 2020 20:01:37 +0200 Subject: [PATCH] Fix a deadlock exposed by the previous patch. --- nageru/mixer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nageru/mixer.cpp b/nageru/mixer.cpp index 5f5bc13..85e5ade 100644 --- a/nageru/mixer.cpp +++ b/nageru/mixer.cpp @@ -574,7 +574,9 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, CardT CaptureCard *card = &cards[card_index]; if (card->capture != nullptr) { + card_mutex.unlock(); // The dequeue thread could be waiting for bm_frame(). card->capture->stop_dequeue_thread(); + card_mutex.lock(); } card->capture.reset(capture); card->is_fake_capture = (card_type == CardType::FAKE_CAPTURE); -- 2.39.2