mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-07 23:57:50 -04: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:
|
//Attach to sound output:
|
||||||
std::map<int, RtAudio::DeviceInfo>::iterator i;
|
std::map<int, RtAudio::DeviceInfo>::iterator i;
|
||||||
|
|
||||||
|
bool matching_device_found = false;
|
||||||
|
|
||||||
for (i = outputDevices.begin(); i != outputDevices.end(); i++) {
|
for (i = outputDevices.begin(); i != outputDevices.end(); i++) {
|
||||||
if (i->second.name == output_device) {
|
if (i->second.name == output_device) {
|
||||||
newDemod->setOutputDevice(i->first);
|
newDemod->setOutputDevice(i->first);
|
||||||
|
matching_device_found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//if no device is found, choose the first of the list anyway.
|
||||||
|
if (!matching_device_found) {
|
||||||
|
newDemod->setOutputDevice(outputDevices.begin()->first);
|
||||||
|
}
|
||||||
|
|
||||||
return newDemod;
|
return newDemod;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user