]> git.sesse.net Git - nageru/commitdiff
Fix a missing lock around handle_hotplugged_cards().
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Jun 2020 16:17:34 +0000 (18:17 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Jun 2020 16:17:34 +0000 (18:17 +0200)
nageru/mixer.cpp

index 3b7a99c0319ea567a0f5fcb38f17075ef9d7151d..5f5bc133f8470f6f893661549c566451bd484bd3 100644 (file)
@@ -1289,7 +1289,10 @@ void Mixer::thread_func()
                        assert(master_card_index < MAX_VIDEO_CARDS);
                }
 
-               handle_hotplugged_cards();
+               {
+                       lock_guard<mutex> lock(card_mutex);
+                       handle_hotplugged_cards();
+               }
 
                vector<int32_t> raw_audio[MAX_VIDEO_CARDS];  // For MJPEG encoding.
                OutputFrameInfo output_frame_info = get_one_frame_from_each_card(master_card_index, master_card_is_output, new_frames, has_new_frame, raw_audio);