don't RageException::Throw from a thread

This commit is contained in:
Glenn Maynard
2007-05-03 02:10:26 +00:00
parent 11a5727d7e
commit c5448c61d5
2 changed files with 6 additions and 6 deletions
@@ -62,7 +62,7 @@ bool RageSoundDriver_OSS::GetData()
/* Look for a free buffer. */
audio_buf_info ab;
if( ioctl(fd, SNDCTL_DSP_GETOSPACE, &ab) == -1 )
RageException::Throw("ioctl(SNDCTL_DSP_GETOSPACE): %s", strerror(errno) );
FAIL_M( ssprintf("ioctl(SNDCTL_DSP_GETOSPACE): %s", strerror(errno)) );
if( !ab.fragments )
return false;
@@ -77,7 +77,7 @@ bool RageSoundDriver_OSS::GetData()
int wrote = write( fd, buf, chunksize );
if( wrote != chunksize )
RageException::Throw( "write didn't: %i (%s)", wrote, wrote == -1? strerror(errno): "" );
FAIL_M( ssprintf("write didn't: %i (%s)", wrote, wrote == -1? strerror(errno): "") );
/* Increment last_cursor_pos. */
last_cursor_pos += chunksize / bytes_per_frame;
@@ -93,7 +93,7 @@ int64_t RageSoundDriver_OSS::GetPosition() const
int delay;
if(ioctl(fd, SNDCTL_DSP_GETODELAY, &delay) == -1)
RageException::Throw("RageSoundDriver_OSS: ioctl(SNDCTL_DSP_GETODELAY): %s", strerror(errno));
FAIL_M( ssprintf("RageSoundDriver_OSS: ioctl(SNDCTL_DSP_GETODELAY): %s", strerror(errno)) );
return last_cursor_pos - (delay / bytes_per_frame);
}
@@ -73,8 +73,8 @@ 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)
RageException::Throw(wo_ssprintf(ret, "waveOutWrite failed"));
if( ret != MMSYSERR_NOERROR )
FAIL_M( wo_ssprintf(ret, "waveOutWrite failed") );
/* Increment m_iLastCursorPos. */
m_iLastCursorPos += chunksize_frames;
@@ -94,7 +94,7 @@ int64_t RageSoundDriver_WaveOut::GetPosition() const
tm.wType = TIME_SAMPLES;
MMRESULT ret = waveOutGetPosition( m_hWaveOut, &tm, sizeof(tm) );
if( ret != MMSYSERR_NOERROR )
RageException::Throw( wo_ssprintf(ret, "waveOutGetPosition failed") );
FAIL_M( wo_ssprintf(ret, "waveOutGetPosition failed") );
return tm.u.sample;
}