http://projects.blender.org/tracker/index.php?func=detail&aid=1415&group_id=9&atid=125
Also release the OpenAL device & context. These were leaked before, and would cause an assertion.
delete m_instance;
m_instance = NULL;
}
delete m_instance;
m_instance = NULL;
}
+
+ if (m_subscriptions < 0)
+ m_subscriptions = 0;
SND_OpenALDevice::SND_OpenALDevice()
SND_OpenALDevice::SND_OpenALDevice()
+ : m_context(NULL),
+ m_device(NULL)
{
/* Removed the functionality for checking if noaudio was provided on */
/* the commandline. */
{
/* Removed the functionality for checking if noaudio was provided on */
/* the commandline. */
if (m_context) {
alcMakeContextCurrent(m_context);
m_audio = true;
if (m_context) {
alcMakeContextCurrent(m_context);
m_audio = true;
SND_OpenALDevice::~SND_OpenALDevice()
{
if (m_context) {
SND_OpenALDevice::~SND_OpenALDevice()
{
if (m_context) {
- alcMakeContextCurrent(m_context);
-
if (m_buffersinitialized)
alDeleteBuffers(NUM_BUFFERS, m_buffers);
if (m_sourcesinitialized)
alDeleteSources(NUM_SOURCES, m_sources);
if (m_buffersinitialized)
alDeleteBuffers(NUM_BUFFERS, m_buffers);
if (m_sourcesinitialized)
alDeleteSources(NUM_SOURCES, m_sources);
+
+ alcDestroyContext(m_context);
+ m_context = NULL;
}
// let's see if we used the cd. if not, just leave it alone
}
// let's see if we used the cd. if not, just leave it alone
if (m_cdrom)
delete m_cdrom;
#endif
if (m_cdrom)
delete m_cdrom;
#endif
+#ifdef OUDE_OPENAL
+ if (m_audio)
+ alutExit();
+#else
+ if (m_device)
+ alcCloseDevice((ALCdevice*) m_device);
+#endif
alSourcefv(m_sources[id], AL_POSITION, obpos);
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
alSourcefv(m_sources[id], AL_POSITION, obpos);
alSourcefv(m_sources[id], AL_VELOCITY, obvel);
alSourcef(m_sources[id], AL_GAIN, 1.0);
alSourcef(m_sources[id], AL_PITCH, 1.0);
alSourcei(m_sources[id], AL_LOOPING, AL_FALSE);
alSourcef(m_sources[id], AL_GAIN, 1.0);
alSourcef(m_sources[id], AL_PITCH, 1.0);
alSourcei(m_sources[id], AL_LOOPING, AL_FALSE);
private:
void* m_context;
private:
void* m_context;
unsigned int m_buffers[NUM_BUFFERS];
unsigned int m_sources[NUM_SOURCES];
unsigned int m_buffers[NUM_BUFFERS];
unsigned int m_sources[NUM_SOURCES];
{
filetype = SAMPLE_OGG_VORBIS;
}
{
filetype = SAMPLE_OGG_VORBIS;
}
- else if ((!memcmp(buffer, "ID3", 3)) || (!memcmp(buffer, "ÿû", 2)))
+ else if ((!memcmp(buffer, "ID3", 3)) || (!memcmp(buffer, "", 2)))
{
filetype = SAMPLE_MP3;
}
{
filetype = SAMPLE_MP3;
}
SYS_SystemHandle hSystem = NULL;
if(ghSoundScene==NULL) {
SYS_SystemHandle hSystem = NULL;
if(ghSoundScene==NULL) {
-
- printf("sound init audio\n");
-
hSystem = SYS_GetSystem();
noaudio = SYS_GetCommandLineInt(hSystem,"noaudio",0);
hSystem = SYS_GetSystem();
noaudio = SYS_GetCommandLineInt(hSystem,"noaudio",0);
if(ghSoundScene) {
SND_DeleteScene(ghSoundScene);
SND_ReleaseDevice();
if(ghSoundScene) {
SND_DeleteScene(ghSoundScene);
SND_ReleaseDevice();
scene_cfra_store= save_and_reset_all_scene_cfra();
scene_cfra_store= save_and_reset_all_scene_cfra();
- /* sound init is save, only handles once */
- sound_init_audio();
+ /* game engine will do its own sounds. */
/* Before jumping into Ketsji, we configure some settings. */
space_set_commmandline_options();
/* Before jumping into Ketsji, we configure some settings. */
space_set_commmandline_options();