From bc963463f3f089a53375e3783c48340a50f65d09 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 19 Jan 2008 19:38:06 -0800 Subject: Add an option for setting the max number of sources --- Alc/ALc.c | 4 +++- alsoftrc.sample | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Alc/ALc.c b/Alc/ALc.c index 0d6af1dc..83ff7ba4 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -1156,7 +1156,9 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALCchar *deviceName) if((ALint)device->UpdateFreq <= 0) device->UpdateFreq = 8192; - device->MaxNoOfSources = 256; + device->MaxNoOfSources = GetConfigValueInt(NULL, "sources", 256); + if((ALint)device->MaxNoOfSources <= 0) + device->MaxNoOfSources = 256; // Find a playback device to open for(i = 0;BackendList[i].Init;i++) diff --git a/alsoftrc.sample b/alsoftrc.sample index 78abb924..c3bb9e83 100644 --- a/alsoftrc.sample +++ b/alsoftrc.sample @@ -40,6 +40,10 @@ frequency = 44100 # Sets the output frequency. Default is 44100 refresh = 8192 # Sets the buffer size, in frames. Default is 8192. Note that # the actual granularity may or may not be less than this. +sources = 256 # Sets the maximum number of allocatable sources. Lower values + # may help for systems with apps that try to play more sounds + # than the CPU can handle. Default is 256 + drivers = # Sets the backend driver list order, comma-seperated. Unknown # backends and duplicated names are ignored, and unlisted backends # won't be considered for use. An empty list means the default. -- cgit v1.2.3