only attenuate when there's really data

This commit is contained in:
Glenn Maynard
2004-02-11 01:34:12 +00:00
parent 1b69bfdff9
commit 8456bd0646
@@ -98,6 +98,8 @@ bool RageSound_ALSA9::stream::GetData(bool init)
bytes_read += got;
bytes_left -= got;
RageSoundManager::AttenuateBuf( buf, got, snd->GetVolume() );
if( bytes_left > 0 )
{
/* Fill the remainder of the buffer with silence. */
@@ -115,8 +117,6 @@ bool RageSound_ALSA9::stream::GetData(bool init)
memset( buf, 0, len );
}
RageSoundManager::AttenuateBuf( buf, max_writeahead*samples_per_frame, snd->GetVolume() );
pcm->Write( buf, frames_to_fill );
return true;