From fb97ca6022308e5898dbfa43958f61bcaed82f30 Mon Sep 17 00:00:00 2001 From: Chris Robinson <chris.kcat@gmail.com> Date: Wed, 16 Sep 2009 23:29:32 -0700 Subject: Remove left-over backend-specific period options --- Alc/alsa.c | 4 ++-- Alc/dsound.c | 3 --- Alc/oss.c | 6 +++--- Alc/portaudio.c | 5 ----- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Alc/alsa.c b/Alc/alsa.c index 2adf7b02..956d69b7 100644 --- a/Alc/alsa.c +++ b/Alc/alsa.c @@ -441,7 +441,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) } allowmmap = GetConfigValueBool("alsa", "mmap", 1); - periods = GetConfigValueInt("alsa", "periods", device->NumUpdates); + periods = device->NumUpdates; periodSizeInFrames = device->UpdateSize; rate = device->Frequency; @@ -464,7 +464,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) if(err == NULL && (i=psnd_pcm_hw_params_set_channels(data->pcmHandle, p, aluChannelsFromFormat(device->Format))) < 0) err = "set channels"; /* set periods (implicitly constrains period/buffer parameters) */ - if(err == NULL && periods && (i=psnd_pcm_hw_params_set_periods_near(data->pcmHandle, p, &periods, NULL)) < 0) + if(err == NULL && (i=psnd_pcm_hw_params_set_periods_near(data->pcmHandle, p, &periods, NULL)) < 0) err = "set periods near"; /* set rate (implicitly constrains period/buffer parameters) */ if(err == NULL && (i=psnd_pcm_hw_params_set_rate_near(data->pcmHandle, p, &rate, NULL)) < 0) diff --git a/Alc/dsound.c b/Alc/dsound.c index 959f55d2..a704c454 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -342,9 +342,6 @@ static ALCboolean DSoundResetPlayback(ALCdevice *device) if(SUCCEEDED(hr)) { - DWORD num_frags = GetConfigValueInt("dsound", "periods", device->NumUpdates); - if(num_frags < 2) num_frags = 2; - memset(&DSBDescription,0,sizeof(DSBUFFERDESC)); DSBDescription.dwSize=sizeof(DSBUFFERDESC); DSBDescription.dwFlags=DSBCAPS_GLOBALFOCUS|DSBCAPS_GETCURRENTPOSITION2; diff --git a/Alc/oss.c b/Alc/oss.c index 7c7fe73f..6cf4c495 100644 --- a/Alc/oss.c +++ b/Alc/oss.c @@ -221,9 +221,7 @@ static ALCboolean oss_reset_playback(ALCdevice *device) AL_PRINT("Unknown format?! %x\n", device->Format); } - periods = GetConfigValueInt("oss", "periods", device->NumUpdates); - if((int)periods < 2) - periods = 4; + periods = device->NumUpdates; numChannels = aluChannelsFromFormat(device->Format); frameSize = numChannels * aluBytesFromFormat(device->Format); @@ -233,6 +231,8 @@ static ALCboolean oss_reset_playback(ALCdevice *device) /* according to the OSS spec, 16 bytes are the minimum */ if (log2FragmentSize < 4) log2FragmentSize = 4; + /* Subtract one period since the temp mixing buffer counts as one. Still + * need at least two on the card, though. */ if(periods > 2) periods--; numFragmentsLogSize = (periods << 16) | log2FragmentSize; diff --git a/Alc/portaudio.c b/Alc/portaudio.c index e7330999..5e0687b1 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -73,7 +73,6 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName) const PaStreamInfo *streamInfo; PaStreamParameters outParams; pa_data *data; - int periods; PaError err; if(pa_handle == NULL) @@ -109,10 +108,6 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName) outParams.sampleFormat = -1; AL_PRINT("Unknown format?! %x\n", device->Format); } - - periods = GetConfigValueInt("port", "periods", 4); - if((int)periods <= 0) - periods = 4; outParams.channelCount = aluChannelsFromFormat(device->Format); err = pPa_OpenStream(&data->stream, NULL, &outParams, device->Frequency, -- cgit v1.2.3