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.
This commit is contained in:
jp9000
2017-05-20 12:30:42 -07:00
parent 87f14a1254
commit cd52679160

View File

@@ -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;
}