diff options
author | Chris Robinson <[email protected]> | 2008-02-14 22:05:56 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-02-14 22:05:56 -0800 |
commit | 8c3188bc7dc2f47a27398fc61ed2dacd36397190 (patch) | |
tree | 5c46bd2fb13355a1bdb6f6118b86bee9452f2859 /Alc/dsound.c | |
parent | 880196e5a811356c4a6b36798a81429b4a48eb40 (diff) |
Remove FrameSize struct member
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r-- | Alc/dsound.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c index 34f6d538..6dc87057 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -71,7 +71,9 @@ static ALuint DSoundProc(ALvoid *ptr) DWORD avail; HRESULT err; - BufferSize = pDevice->UpdateSize*DS_FRAGS*pDevice->FrameSize; + BufferSize = pDevice->UpdateSize * DS_FRAGS * + aluBytesFromFormat(pDevice->Format) * + aluChannelsFromFormat(pDevice->Format); while(!pData->killNow) { @@ -128,6 +130,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam DSBUFFERDESC DSBDescription; DSoundData *pData = NULL; WAVEFORMATEXTENSIBLE OutputType; + DWORD frameSize = 0; LPGUID guid = NULL; DWORD speakers; HRESULT hr; @@ -225,8 +228,8 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT; } - device->FrameSize = aluBytesFromFormat(device->Format) * - aluChannelsFromFormat(device->Format); + frameSize = aluBytesFromFormat(device->Format) * + aluChannelsFromFormat(device->Format); OutputType.Format.wFormatTag = WAVE_FORMAT_PCM; OutputType.Format.nChannels = aluChannelsFromFormat(device->Format); @@ -264,7 +267,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam memset(&DSBDescription,0,sizeof(DSBUFFERDESC)); DSBDescription.dwSize=sizeof(DSBUFFERDESC); DSBDescription.dwFlags=DSBCAPS_GLOBALFOCUS|DSBCAPS_GETCURRENTPOSITION2; - DSBDescription.dwBufferBytes=device->UpdateSize * DS_FRAGS * device->FrameSize; + DSBDescription.dwBufferBytes=device->UpdateSize * DS_FRAGS * frameSize; DSBDescription.lpwfxFormat=&OutputType.Format; hr = IDirectSound_CreateSoundBuffer(pData->lpDS, &DSBDescription, &pData->DSsbuffer, NULL); } |