Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recording exception #214

Open
lywxs opened this issue May 13, 2019 · 0 comments
Open

Fix recording exception #214

lywxs opened this issue May 13, 2019 · 0 comments

Comments

@lywxs
Copy link

lywxs commented May 13, 2019

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) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant