diff --git a/src/audio.cpp b/src/audio.cpp index 502e1d86..f14ecc2f 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -94,17 +94,16 @@ void Port::setDriverId(int driverId) { driver = NULL; this->driverId = -1; - if (driverId == -1) { + // Find driver by ID + driver = audio::getDriver(driverId); + if (driver) { + this->driverId = driverId; + } + else { // Set first driver as default driver = drivers[0].second; this->driverId = drivers[0].first; } - else { - // Find driver by ID - driver = audio::getDriver(driverId); - if (driver) - this->driverId = driverId; - } } void Port::setDeviceId(int deviceId) {