Fix for cell change OpenAL music streaming issue

actorid
Michael Papageorgiou 13 years ago
parent f3c9694bf2
commit 14b2851e72

@ -30,8 +30,11 @@ static char tmp_buffer[BSIZE];
// Number of buffers used (per sound) for streaming sounds. Each
// buffer is of size BSIZE. Increasing this will make streaming sounds
// more fault tolerant against temporary lapses in call to update(),
// but will also increase memory usage. 4 should be ok.
const int STREAM_BUF_NUM = 4;
// but will also increase memory usage.
// This was changed from 4 to 150 for an estimated 30 seconds tolerance.
// At some point we should replace it with a more multithreading-ish
// solution.
const int STREAM_BUF_NUM = 150;
static void fail(const std::string &msg)
{ throw std::runtime_error("OpenAL exception: " + msg); }
@ -101,7 +104,7 @@ class Mangle::Sound::OpenAL_Sound : public Sound
ALuint inst;
// Buffers. Only the first is used for non-streaming sounds.
ALuint bufferID[4];
ALuint bufferID[STREAM_BUF_NUM];
// Number of buffers used
int bufNum;

Loading…
Cancel
Save