mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-03-27 17:55:30 +01:00
Merge pull request #1114 from bvernoux/master
Workaround for RtAudio Exception when no Input are connected on Input MIC on some PC
This commit is contained in:
commit
ff7ef78b8f
@ -45,6 +45,7 @@ public:
|
|||||||
int count = audio.getDeviceCount();
|
int count = audio.getDeviceCount();
|
||||||
RtAudio::DeviceInfo info;
|
RtAudio::DeviceInfo info;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
|
try {
|
||||||
info = audio.getDeviceInfo(i);
|
info = audio.getDeviceInfo(i);
|
||||||
if (!info.probed) { continue; }
|
if (!info.probed) { continue; }
|
||||||
if (info.outputChannels == 0) { continue; }
|
if (info.outputChannels == 0) { continue; }
|
||||||
@ -54,7 +55,10 @@ public:
|
|||||||
txtDevList += info.name;
|
txtDevList += info.name;
|
||||||
txtDevList += '\0';
|
txtDevList += '\0';
|
||||||
}
|
}
|
||||||
|
catch (std::exception e) {
|
||||||
|
flog::error("AudioSinkModule Error getting audio device info: {0}", e.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
selectByName(device);
|
selectByName(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user