Browse Source

Use first audio driver if driver ID is not found.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
b26d79dc57
1 changed files with 6 additions and 7 deletions
  1. +6
    -7
      src/audio.cpp

+ 6
- 7
src/audio.cpp View File

@@ -94,17 +94,16 @@ void Port::setDriverId(int driverId) {
driver = NULL; driver = NULL;
this->driverId = -1; 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 // Set first driver as default
driver = drivers[0].second; driver = drivers[0].second;
this->driverId = drivers[0].first; this->driverId = drivers[0].first;
} }
else {
// Find driver by ID
driver = audio::getDriver(driverId);
if (driver)
this->driverId = driverId;
}
} }


void Port::setDeviceId(int deviceId) { void Port::setDeviceId(int deviceId) {


Loading…
Cancel
Save