Open lywxs opened 5 years ago
In the 32bit Windows7 system, when recording or pause, insert a new device that needs to be installed and driven, soundio exception
32位 Win7(也许64位也会有),录音中或者是暂停录音,也就是设备没有释放的时候,插入需要安装驱动的音频设备,soundio崩溃。
fix code: rd.prop_variant_value_inited = true; if (FAILED(hr = IPropertyStore_GetValue(rd.prop_store,PKEY_AUDIOENGINE_DEVICEFORMAT, &rd.prop_variant_value))) { rd.device_shared->probe_error = SoundIoErrorOpeningDevice; rd.device_raw->probe_error = SoundIoErrorOpeningDevice; rd.device_shared = NULL; rd.device_raw = NULL; continue; } // add by liangyaowei if (rd.prop_variant_value.blob.cbSize == 0) { rd.device_shared->probe_error = SoundIoErrorOpeningDevice; rd.device_raw->probe_error = SoundIoErrorOpeningDevice; rd.device_shared = NULL; rd.device_raw = NULL; continue; } // end
WAVEFORMATEXTENSIBLE *valid_wave_format = (WAVEFORMATEXTENSIBLE *)rd.prop_variant_value.blob.pBlobData; if (valid_wave_format->Format.wFormatTag != WAVE_FORMAT_EXTENSIBLE) {
In the 32bit Windows7 system, when recording or pause, insert a new device that needs to be installed and driven, soundio exception
32位 Win7(也许64位也会有),录音中或者是暂停录音,也就是设备没有释放的时候,插入需要安装驱动的音频设备,soundio崩溃。
fix code: rd.prop_variant_value_inited = true; if (FAILED(hr = IPropertyStore_GetValue(rd.prop_store,PKEY_AUDIOENGINE_DEVICEFORMAT, &rd.prop_variant_value))) { rd.device_shared->probe_error = SoundIoErrorOpeningDevice; rd.device_raw->probe_error = SoundIoErrorOpeningDevice; rd.device_shared = NULL; rd.device_raw = NULL; continue; } // add by liangyaowei if (rd.prop_variant_value.blob.cbSize == 0) { rd.device_shared->probe_error = SoundIoErrorOpeningDevice; rd.device_raw->probe_error = SoundIoErrorOpeningDevice; rd.device_shared = NULL; rd.device_raw = NULL; continue; } // end