mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 00:13:29 +02:00
Merge pull request #31 from FluffyJenkins/bug/BrokenAudioNoVR
Audio Failure Due to missing VR fix
This commit is contained in:
commit
b249f94528
1 changed files with 11 additions and 1 deletions
|
@ -108,9 +108,11 @@ QString getVrSettingString(const char* section, const char* setting) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isHMDInErrorState = false;
|
||||||
|
|
||||||
vr::IVRSystem* acquireOpenVrSystem() {
|
vr::IVRSystem* acquireOpenVrSystem() {
|
||||||
bool hmdPresent = vr::VR_IsHmdPresent();
|
bool hmdPresent = vr::VR_IsHmdPresent();
|
||||||
if (hmdPresent) {
|
if (hmdPresent && !isHMDInErrorState) {
|
||||||
Lock lock(mutex);
|
Lock lock(mutex);
|
||||||
if (!activeHmd) {
|
if (!activeHmd) {
|
||||||
#if DEV_BUILD
|
#if DEV_BUILD
|
||||||
|
@ -122,6 +124,14 @@ vr::IVRSystem* acquireOpenVrSystem() {
|
||||||
#if DEV_BUILD
|
#if DEV_BUILD
|
||||||
qCDebug(displayplugins) << "OpenVR display: HMD is " << activeHmd << " error is " << eError;
|
qCDebug(displayplugins) << "OpenVR display: HMD is " << activeHmd << " error is " << eError;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (eError == vr::VRInitError_Init_HmdNotFound) {
|
||||||
|
isHMDInErrorState = true;
|
||||||
|
activeHmd = nullptr;
|
||||||
|
#if DEV_BUILD
|
||||||
|
qCDebug(displayplugins) << "OpenVR: No HMD connected, setting nullptr!";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (activeHmd) {
|
if (activeHmd) {
|
||||||
#if DEV_BUILD
|
#if DEV_BUILD
|
||||||
|
|
Loading…
Reference in a new issue