Skip to content

Commit

Permalink
Make sure the audio system is initialized when a file is passed direc…
Browse files Browse the repository at this point in the history
…tly before starting a file directly.

xaudio2 CreateMasteringVoice "call crashes with with exception coinitialize has not been called".
This fixes that.
  • Loading branch information
goedzo committed Dec 2, 2018
1 parent 4404524 commit 7fada42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/xenia/apu/xaudio2/xaudio2_audio_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ bool XAudio2AudioDriver::Initialize() {
config.LogFileline = TRUE;
audio_->SetDebugConfiguration(&config);

// Make sure the audio is initilized
hr = audio_->StartEngine();
CoInitialize(nullptr);

hr = audio_->CreateMasteringVoice(&mastering_voice_);
if (FAILED(hr)) {
XELOGE("CreateMasteringVoice failed with %.8X", hr);
Expand Down

0 comments on commit 7fada42

Please sign in to comment.