diff options
author | Simon Howard | 2009-05-14 19:45:22 +0000 |
---|---|---|
committer | Simon Howard | 2009-05-14 19:45:22 +0000 |
commit | 664c35903202a2e7c56479eff1786e952718e4df (patch) | |
tree | f8e0c53b9f27f6a7c72cdb228fb041bfe1278aaf /pcsound | |
parent | ebc8378619e9ddca26eb7cda1f4a4f2be1e98091 (diff) | |
parent | 144849eee5804a0306d23f07a5be9877f242a1bf (diff) | |
download | chocolate-doom-664c35903202a2e7c56479eff1786e952718e4df.tar.gz chocolate-doom-664c35903202a2e7c56479eff1786e952718e4df.tar.bz2 chocolate-doom-664c35903202a2e7c56479eff1786e952718e4df.zip |
Merge from trunk. Note that src/i_sdlsound.c has not yet been merged as
it contains too many conflicts at present.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1522
Diffstat (limited to 'pcsound')
-rw-r--r-- | pcsound/pcsound_sdl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pcsound/pcsound_sdl.c b/pcsound/pcsound_sdl.c index f862dfa7..546e6a36 100644 --- a/pcsound/pcsound_sdl.c +++ b/pcsound/pcsound_sdl.c @@ -32,6 +32,7 @@ #include "pcsound.h" #include "pcsound_internal.h" +#define SOUND_SLICE_TIME 100 /* ms */ #define SQUARE_WAVE_AMP 0x2000 // If true, we initialised SDL and have the responsibility to shut it @@ -165,6 +166,8 @@ static void PCSound_SDL_Shutdown(void) static int PCSound_SDL_Init(pcsound_callback_func callback_func) { + int slicesize; + // Check if SDL_mixer has been opened already // If not, we must initialise it now @@ -176,7 +179,9 @@ static int PCSound_SDL_Init(pcsound_callback_func callback_func) return 0; } - if (Mix_OpenAudio(pcsound_sample_rate, AUDIO_S16SYS, 2, 1024) < 0) + slicesize = (SOUND_SLICE_TIME * pcsound_sample_rate) / 1000; + + if (Mix_OpenAudio(pcsound_sample_rate, AUDIO_S16SYS, 2, slicesize) < 0) { fprintf(stderr, "Error initialising SDL_mixer: %s\n", Mix_GetError()); |