]> git.sesse.net Git - nageru/commitdiff
Fix a deadlock exposed by the previous patch.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Jun 2020 18:01:37 +0000 (20:01 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Jun 2020 18:01:37 +0000 (20:01 +0200)
nageru/mixer.cpp

index 5f5bc133f8470f6f893661549c566451bd484bd3..85e5ade8dc294061b0b4af58e606abc4fcd2db5f 100644 (file)
@@ -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);