From 843a7e4ecd7f02ff5a1e217ebce8e31d3d958f18 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 12 Jan 2004 02:13:30 +0000 Subject: [PATCH] stop saying samples when we mean frames --- stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp index 6866d51374..0122045ff2 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp @@ -16,14 +16,14 @@ #include "SDL.h" const int channels = 2; -const int samplesize = 2 * channels; /* 16-bit */ +const int bytes_per_frame = 2 * channels; /* 16-bit */ const int samplerate = 44100; /* The total write-ahead. Don't make this *too* high; we fill the entire * buffer when we start playing, so it can cause frame skips. This should be * high enough that sound cards won't skip. */ const int buffersize_frames = 1024*8; /* in frames */ -const int buffersize = buffersize_frames * samplesize; /* in bytes */ +const int buffersize = buffersize_frames * bytes_per_frame; /* in bytes */ const int num_chunks = 8; const int chunksize = buffersize / num_chunks; @@ -138,8 +138,8 @@ bool RageSound_DSound::stream::GetData(bool init) const float fSilentSecondsInThisBuffer = max( 0, fSecondsBeforeStart-fSecondsUntilThisBuffer ); const int iSilentFramesInThisBuffer = int( fSilentSecondsInThisBuffer * str_ds->GetSampleRate() ); - const int iActualSilentFramesInThisBuffer = min( iSilentFramesInThisBuffer, (int) bytes_left/samplesize ); - const int iSilentBytesInThisBuffer = iActualSilentFramesInThisBuffer * samplesize; + const int iActualSilentFramesInThisBuffer = min( iSilentFramesInThisBuffer, (int) bytes_left/bytes_per_frame ); + const int iSilentBytesInThisBuffer = iActualSilentFramesInThisBuffer * bytes_per_frame; memset( locked_buf, 0, iSilentBytesInThisBuffer ); bytes_read += iSilentBytesInThisBuffer; @@ -149,7 +149,7 @@ bool RageSound_DSound::stream::GetData(bool init) start_time.SetZero(); } - unsigned got = snd->GetPCM( locked_buf+bytes_read, len-bytes_read, play_pos + (bytes_read/samplesize)); + unsigned got = snd->GetPCM( locked_buf+bytes_read, len-bytes_read, play_pos + (bytes_read/bytes_per_frame)); bytes_read += got; if( bytes_read < len )