Skip to content

Commit

Permalink
Fix an audio crash on windows
Browse files Browse the repository at this point in the history
Happened when you changed output device
  • Loading branch information
nico-abram authored Aug 26, 2018
1 parent 3548df3 commit c444cbf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/arch/Sound/RageSoundDriver_WaveOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ bool RageSoundDriver_WaveOut::GetData()
this->Mix( (int16_t *) m_aBuffers[b].lpData, chunksize_frames, m_iLastCursorPos, GetPosition() );

MMRESULT ret = waveOutWrite( m_hWaveOut, &m_aBuffers[b], sizeof(m_aBuffers[b]) );
if( ret != MMSYSERR_NOERROR )
FAIL_M( wo_ssprintf(ret, "waveOutWrite failed") );
if (ret != MMSYSERR_NOERROR)
if (ret == WAVERR_STILLPLAYING)
return false;
else
FAIL_M( wo_ssprintf(ret, "waveOutWrite failed") );

/* Increment m_iLastCursorPos. */
m_iLastCursorPos += chunksize_frames;
Expand Down

0 comments on commit c444cbf

Please sign in to comment.