From a270ae7984eade3942ac3bcd17d87bb785852ac0 Mon Sep 17 00:00:00 2001 From: casey langen Date: Mon, 15 Jan 2018 13:56:08 -0800 Subject: [PATCH] Fixed a bug in set_output_driver message -- the correctt deviceId wasn't always getting selected (default was broken) --- src/plugins/server/WebSocketServer.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/plugins/server/WebSocketServer.cpp b/src/plugins/server/WebSocketServer.cpp index 104dcb701..71c8fa728 100644 --- a/src/plugins/server/WebSocketServer.cpp +++ b/src/plugins/server/WebSocketServer.cpp @@ -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);