diff --git a/stepmania/src/arch/Sound/DSoundHelpers.cpp b/stepmania/src/arch/Sound/DSoundHelpers.cpp index 6a5d9a4ece..6784452743 100644 --- a/stepmania/src/arch/Sound/DSoundHelpers.cpp +++ b/stepmania/src/arch/Sound/DSoundHelpers.cpp @@ -20,11 +20,6 @@ BOOL CALLBACK DSound::EnumCallback(LPGUID lpGuid, LPCSTR lpcstrDescription, LPCS return TRUE; } -/* The PortAudio directsound code does this. I'm not sure if it actually matters; - * it's an experiment based on some recent reports. (The default primary buffer - * mode is 22050 8-bit. However, we mix through secondary buffers, and I'm not sure - * when the primary buffer mode matters there--I'm certainly not getting 22050 8-bit - * sound.) */ void DSound::SetPrimaryBufferMode() { #ifndef _XBOX @@ -397,7 +392,7 @@ bool DSoundBuf::get_output_buf(char **buffer, unsigned *bufsiz, int chunksize) /* Increment last_cursor_pos to point at where the data we're about to * ask for will actually be played. */ - last_cursor_pos += num_bytes_empty / samplesize(); + last_cursor_pos += num_bytes_empty / bytes_per_frame(); buffer_locked = true; @@ -414,8 +409,8 @@ int DSoundBuf::GetPosition() const { DWORD cursor, junk; buf->GetCurrentPosition(&cursor, &junk); - int cursor_frames = int(cursor) / samplesize(); - int write_cursor_frames = write_cursor / samplesize(); + int cursor_frames = int(cursor) / bytes_per_frame(); + int write_cursor_frames = write_cursor / bytes_per_frame(); int frames_behind = write_cursor_frames - cursor_frames; if(frames_behind <= 0) diff --git a/stepmania/src/arch/Sound/DSoundHelpers.h b/stepmania/src/arch/Sound/DSoundHelpers.h index 307b2b6be3..4adfc8d03c 100644 --- a/stepmania/src/arch/Sound/DSoundHelpers.h +++ b/stepmania/src/arch/Sound/DSoundHelpers.h @@ -31,8 +31,8 @@ class DSoundBuf int buffersize; - int buffersize_frames() const { return buffersize / samplesize(); } - int samplesize() const { return channels*samplebits/8; } + int buffersize_frames() const { return buffersize / bytes_per_frame(); } + int bytes_per_frame() const { return channels*samplebits/8; } int write_cursor, buffer_bytes_filled; /* bytes */ int last_cursor_pos; /* frames */ diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp index 932d1b0d69..3cf6cc400d 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp @@ -12,10 +12,10 @@ /* samples */ const int channels = 2; -const int samplesize = channels*2; /* 16-bit */ +const int bytes_per_frame = channels*2; /* 16-bit */ const int samplerate = 44100; const int buffersize_frames = 1024*4; /* in frames */ -const int buffersize = buffersize_frames * samplesize; /* in bytes */ +const int buffersize = buffersize_frames * bytes_per_frame; /* in bytes */ /* We'll fill the buffer in chunks this big. This should evenly divide the * buffer size. */ @@ -154,7 +154,7 @@ void RageSound_DSound_Software::StopMixing(RageSound *snd) delete sounds[i]; sounds.erase(sounds.begin()+i, sounds.begin()+i+1); - /* If nothing is playing, reset the sample count; this is just to + /* If nothing is playing, reset the frame count; this is just to * prevent eventual overflow. */ if(sounds.empty()) str_ds->Reset();