diff options
author | Moonchild <moonchild@palemoon.org> | 2020-09-23 02:10:26 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-23 08:29:06 +0000 |
commit | 04479387a21dd0bbf6006e27ec49101d1f2380a4 (patch) | |
tree | 119ed09dcef670f24f7bea2a1f1bedb3134d9e34 /dom/media/webaudio/blink/HRTFDatabaseLoader.cpp | |
parent | b0c271c7f974ff533729ad63c4e5d6f9f0ca0d25 (diff) | |
download | UXP-04479387a21dd0bbf6006e27ec49101d1f2380a4.tar UXP-04479387a21dd0bbf6006e27ec49101d1f2380a4.tar.gz UXP-04479387a21dd0bbf6006e27ec49101d1f2380a4.tar.lz UXP-04479387a21dd0bbf6006e27ec49101d1f2380a4.tar.xz UXP-04479387a21dd0bbf6006e27ec49101d1f2380a4.zip |
[webaudio] Keep track of whether the HRTF database has already been loaded.
This DiD measure ensures that our async HRTF database loading is completed
before we actually try to use it. If not done, database() simply returns null.
Diffstat (limited to 'dom/media/webaudio/blink/HRTFDatabaseLoader.cpp')
-rw-r--r-- | dom/media/webaudio/blink/HRTFDatabaseLoader.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dom/media/webaudio/blink/HRTFDatabaseLoader.cpp b/dom/media/webaudio/blink/HRTFDatabaseLoader.cpp index 090e1b217..96c53b1cd 100644 --- a/dom/media/webaudio/blink/HRTFDatabaseLoader.cpp +++ b/dom/media/webaudio/blink/HRTFDatabaseLoader.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2020 M. Straver. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -72,6 +73,7 @@ HRTFDatabaseLoader::HRTFDatabaseLoader(float sampleRate) , m_threadLock("HRTFDatabaseLoader") , m_databaseLoaderThread(nullptr) , m_databaseSampleRate(sampleRate) + , m_databaseLoaded(false) { MOZ_ASSERT(NS_IsMainThread()); } @@ -164,6 +166,7 @@ void HRTFDatabaseLoader::load() MOZ_ASSERT(!m_hrtfDatabase.get(), "Called twice"); // Load the default HRTF database. m_hrtfDatabase = HRTFDatabase::create(m_databaseSampleRate); + m_databaseLoaded = true; // Notifies the main thread of completion. See loadAsynchronously(). Release(); } |