mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-29 23:28:39 -05:00
Choose a valid audio output if the modem-saved one is not recognized.
This commit is contained in:
parent
d4251b41fb
commit
8f45451df2
@ -526,12 +526,20 @@ DemodulatorInstancePtr DemodulatorMgr::loadInstance(DataNode *node) {
|
||||
|
||||
//Attach to sound output:
|
||||
std::map<int, RtAudio::DeviceInfo>::iterator i;
|
||||
|
||||
bool matching_device_found = false;
|
||||
|
||||
for (i = outputDevices.begin(); i != outputDevices.end(); i++) {
|
||||
if (i->second.name == output_device) {
|
||||
newDemod->setOutputDevice(i->first);
|
||||
matching_device_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//if no device is found, choose the first of the list anyway.
|
||||
if (!matching_device_found) {
|
||||
newDemod->setOutputDevice(outputDevices.begin()->first);
|
||||
}
|
||||
|
||||
return newDemod;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user