Browse Source

UI: Unlock mutex before trying to stop output

Prevents the output from hard-locking on itself when the stop call would
trigger the callback and then try to lock again.  Probably could be
solved with a recursive mutex, but at that point it's not really
necessary.
jp9000 8 years ago
parent
commit
cd52679160
1 changed files with 3 additions and 0 deletions
  1. 3 0
      UI/window-basic-auto-config-test.cpp

+ 3 - 0
UI/window-basic-auto-config-test.cpp

@@ -338,12 +338,14 @@ void AutoConfigTestPage::TestBandwidthThread()
 
 		unique_lock<mutex> ul(m);
 		if (cancel) {
+			ul.unlock();
 			obs_output_force_stop(output);
 			return;
 		}
 		if (!stopped && !connected)
 			cv.wait(ul);
 		if (cancel) {
+			ul.unlock();
 			obs_output_force_stop(output);
 			return;
 		}
@@ -360,6 +362,7 @@ void AutoConfigTestPage::TestBandwidthThread()
 		if (stopped)
 			continue;
 		if (cancel) {
+			ul.unlock();
 			obs_output_force_stop(output);
 			return;
 		}