Bugfixes (that could potentially segfault) in PortAudio backend.
This commit is contained in:
parent
46bef007ca
commit
373dcfb60f
@ -69,6 +69,8 @@ void fillPortAudioDeviceInfo(DeviceInfoList &devinfolist) {
|
||||
}
|
||||
OurPaDeviceInfo d;
|
||||
d._paDevInfo = *deviceInfo;
|
||||
// We store the name in d.device_name
|
||||
d._paDevInfo.name = nullptr;
|
||||
d.api = portaudioApi;
|
||||
d.device_name = deviceInfo->name;
|
||||
|
||||
@ -87,6 +89,9 @@ void fillPortAudioDeviceInfo(DeviceInfoList &devinfolist) {
|
||||
d.prefFramesPerBlockIndex = 2;
|
||||
|
||||
d.availableInputRanges = {1.0};
|
||||
// d.prefInputRangeIndex = 0; // Constructor-defined
|
||||
d.availableOutputRanges = {1.0};
|
||||
// d.prefOutputRangeIndex = 0; // Constructor-defined
|
||||
|
||||
d.ninchannels = deviceInfo->maxInputChannels;
|
||||
d.noutchannels = deviceInfo->maxOutputChannels;
|
||||
@ -194,12 +199,13 @@ PortAudioDaq::PortAudioDaq(const OurPaDeviceInfo &devinfo_gen,
|
||||
// the index, as this is required in the PaStreamParameters struct
|
||||
int devindex = -1;
|
||||
for (int i = 0; i < Pa_GetDeviceCount(); i++) {
|
||||
// DEBUGTRACE_PRINT(i);
|
||||
bool ok = true;
|
||||
const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
|
||||
if (!info) {
|
||||
throw rte("No device structure returned from PortAudio");
|
||||
}
|
||||
ok &= string(info->name) == devinfo_gen._paDevInfo.name;
|
||||
ok &= string(info->name) == devinfo_gen.device_name;
|
||||
ok &= info->hostApi == devinfo_gen._paDevInfo.hostApi;
|
||||
ok &= info->maxInputChannels == devinfo_gen._paDevInfo.maxInputChannels;
|
||||
ok &= info->maxOutputChannels == devinfo_gen._paDevInfo.maxOutputChannels;
|
||||
|
2
third_party/portaudio
vendored
2
third_party/portaudio
vendored
@ -1 +1 @@
|
||||
Subproject commit cb8d3dcbc6fa74c67f3e236be89b12d5630da141
|
||||
Subproject commit daaf637f6f9fce670031221abfd7dfde92e5cce3
|
Loading…
Reference in New Issue
Block a user