Rename UpdateFreq device field to UpdateSize

This commit is contained in:
Chris Robinson
2008-02-12 19:38:27 -08:00
parent fbc869eed7
commit c3446a10fa
6 changed files with 21 additions and 21 deletions
+5 -5
View File
@@ -753,7 +753,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
data[i++] = device->Frequency;
data[i++] = ALC_REFRESH;
data[i++] = device->Frequency / device->UpdateFreq;
data[i++] = device->Frequency / device->UpdateSize;
data[i++] = ALC_SYNC;
data[i++] = ALC_FALSE;
@@ -791,7 +791,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
else if(!size)
SetALCError(ALC_INVALID_VALUE);
else
*data = device->Frequency / device->UpdateFreq;
*data = device->Frequency / device->UpdateSize;
break;
case ALC_SYNC:
@@ -1177,9 +1177,9 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALCchar *deviceName)
device->FrameSize = aluBytesFromFormat(device->Format) *
aluChannelsFromFormat(device->Format);
device->UpdateFreq = GetConfigValueInt(NULL, "refresh", 8192);
if((ALint)device->UpdateFreq <= 0)
device->UpdateFreq = 8192;
device->UpdateSize = GetConfigValueInt(NULL, "refresh", 8192);
if((ALint)device->UpdateSize <= 0)
device->UpdateSize = 8192;
device->MaxNoOfSources = GetConfigValueInt(NULL, "sources", 256);
if((ALint)device->MaxNoOfSources <= 0)
+3 -3
View File
@@ -357,7 +357,7 @@ open_alsa:
}
periods = GetConfigValueInt("alsa", "periods", 0);
bufferSizeInFrames = device->UpdateFreq;
bufferSizeInFrames = device->UpdateSize;
str = GetConfigValue("alsa", "mmap", "true");
allowmmap = (strcasecmp(str, "true") == 0 ||
@@ -413,9 +413,9 @@ open_alsa:
psnd_pcm_hw_params_free(p);
device->UpdateFreq = bufferSizeInFrames;
device->UpdateSize = bufferSizeInFrames;
data->size = psnd_pcm_frames_to_bytes(data->pcmHandle, device->UpdateFreq);
data->size = psnd_pcm_frames_to_bytes(data->pcmHandle, device->UpdateSize);
if(access == SND_PCM_ACCESS_RW_INTERLEAVED)
{
data->buffer = malloc(data->size);
+3 -3
View File
@@ -73,7 +73,7 @@ static ALuint DSoundProc(ALvoid *ptr)
DWORD avail;
HRESULT err;
BufferSize = pDevice->UpdateFreq*DS_FRAGS*pDevice->FrameSize;
BufferSize = pDevice->UpdateSize*DS_FRAGS*pDevice->FrameSize;
while(!pData->killNow)
{
@@ -238,7 +238,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
OutputType.Format.nAvgBytesPerSec = OutputType.Format.nSamplesPerSec*OutputType.Format.nBlockAlign;
OutputType.Format.cbSize = 0;
device->UpdateFreq /= DS_FRAGS;
device->UpdateSize /= DS_FRAGS;
}
if(OutputType.Format.nChannels > 2)
@@ -266,7 +266,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->UpdateFreq * DS_FRAGS * device->FrameSize;
DSBDescription.dwBufferBytes=device->UpdateSize * DS_FRAGS * device->FrameSize;
DSBDescription.lpwfxFormat=&OutputType.Format;
hr = IDirectSound_CreateSoundBuffer(pData->lpDS, &DSBDescription, &pData->DSsbuffer, NULL);
}
+6 -6
View File
@@ -197,7 +197,7 @@ static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName
periods = 4;
numChannels = aluChannelsFromFormat(device->Format);
ossSpeed = device->Frequency;
log2FragmentSize = log2i(device->UpdateFreq * device->FrameSize / periods);
log2FragmentSize = log2i(device->UpdateSize * device->FrameSize / periods);
/* according to the OSS spec, 16 bytes are the minimum */
if (log2FragmentSize < 4)
@@ -237,9 +237,9 @@ static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName
return ALC_FALSE;
}
device->UpdateFreq = info.fragsize / device->FrameSize;
device->UpdateSize = info.fragsize / device->FrameSize;
data->data_size = device->UpdateFreq * device->FrameSize;
data->data_size = device->UpdateSize * device->FrameSize;
data->mix_data = calloc(1, data->data_size);
device->ExtraData = data;
@@ -321,7 +321,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName,
periods = 4;
numChannels = aluChannelsFromFormat(device->Format);
ossSpeed = frequency;
log2FragmentSize = log2i(device->UpdateFreq * device->FrameSize / periods);
log2FragmentSize = log2i(device->UpdateSize * device->FrameSize / periods);
/* according to the OSS spec, 16 bytes are the minimum */
if (log2FragmentSize < 4)
@@ -368,9 +368,9 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName,
return ALC_FALSE;
}
device->UpdateFreq = info.fragsize / device->FrameSize;
device->UpdateSize = info.fragsize / device->FrameSize;
data->data_size = device->UpdateFreq * device->FrameSize * info.fragments;
data->data_size = device->UpdateSize * device->FrameSize * info.fragments;
data->mix_data = calloc(1, data->data_size);
device->ExtraData = data;
+3 -3
View File
@@ -66,7 +66,7 @@ static ALuint WaveProc(ALvoid *ptr)
now = timeGetTime();
avail = (now-last) * pDevice->Frequency / 1000;
if(avail < pDevice->UpdateFreq/4)
if(avail < pDevice->UpdateSize/4)
{
Sleep(1);
continue;
@@ -212,9 +212,9 @@ static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceNam
data->DataStart = ftell(data->f);
device->UpdateFreq = max(device->UpdateFreq, 2048);
device->UpdateSize = max(device->UpdateSize, 2048);
data->size = device->UpdateFreq;
data->size = device->UpdateSize;
data->buffer = malloc(data->size * channels * bits / 8);
if(!data->buffer)
{
+1 -1
View File
@@ -139,7 +139,7 @@ struct ALCdevice_struct
ALboolean IsCaptureDevice;
ALuint Frequency;
ALuint UpdateFreq;
ALuint UpdateSize;
ALuint FrameSize;
ALenum Format;