From: Steinar H. Gunderson Date: Mon, 1 Jun 2020 18:01:37 +0000 (+0200) Subject: Fix a deadlock exposed by the previous patch. X-Git-Tag: 2.0.0~11 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=7b32e75002145a22a0bbf0da5de70b54f97ca005 Fix a deadlock exposed by the previous patch. --- 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);