From 0950567791d86f41e54f9c5d178a39146e3c0c08 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 1 Jun 2020 18:17:34 +0200 Subject: [PATCH] Fix a missing lock around handle_hotplugged_cards(). --- nageru/mixer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nageru/mixer.cpp b/nageru/mixer.cpp index 3b7a99c..5f5bc13 100644 --- a/nageru/mixer.cpp +++ b/nageru/mixer.cpp @@ -1289,7 +1289,10 @@ void Mixer::thread_func() assert(master_card_index < MAX_VIDEO_CARDS); } - handle_hotplugged_cards(); + { + lock_guard lock(card_mutex); + handle_hotplugged_cards(); + } vector 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); -- 2.39.2