mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Fixed a bug in set_output_driver message -- the correctt deviceId wasn't
always getting selected (default was broken)
This commit is contained in:
parent
a698bf90a8
commit
a270ae7984
@ -1217,16 +1217,7 @@ void WebSocketServer::RespondWithSetDefaultOutputDriver(connection_hdl connectio
|
||||
auto output = context.environment->GetOutputWithName(driver.c_str());
|
||||
if (output) {
|
||||
std::string device = options.value(key::device_id, "");
|
||||
auto devices = output->GetDeviceList();
|
||||
if (devices) {
|
||||
for (size_t i = 0; i < devices->Count(); i++) {
|
||||
if (devices->At(0)->Id() == device) {
|
||||
output->SetDefaultDevice(device.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
devices->Release();
|
||||
}
|
||||
output->SetDefaultDevice(device.c_str());
|
||||
context.environment->SetDefaultOutput(output);
|
||||
output->Release();
|
||||
this->RespondWithSuccess(connection, request);
|
||||
|
Loading…
Reference in New Issue
Block a user