Aduaspace: fixing playback in the game engine.
This commit is contained in:
@@ -814,10 +814,9 @@ int AUD_Device_read(AUD_Device *device, data_t *buffer, int length)
|
||||
|
||||
void AUD_Device_free(AUD_Device *device)
|
||||
{
|
||||
assert(device);
|
||||
|
||||
try {
|
||||
delete device;
|
||||
if(device != &AUD_device)
|
||||
delete device;
|
||||
}
|
||||
catch(AUD_Exception&)
|
||||
{
|
||||
@@ -1347,6 +1346,11 @@ AUD_Device *AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound *sequencer, f
|
||||
}
|
||||
}
|
||||
|
||||
AUD_Device *AUD_Device_getCurrent(void)
|
||||
{
|
||||
return &AUD_device;
|
||||
}
|
||||
|
||||
int AUD_isJackSupported(void)
|
||||
{
|
||||
#ifdef WITH_JACK
|
||||
|
||||
@@ -811,6 +811,8 @@ extern void *AUD_getPythonSound(AUD_Sound *sound);
|
||||
extern AUD_Sound *AUD_getSoundFromPython(void *sound);
|
||||
#endif
|
||||
|
||||
extern AUD_Device *AUD_Device_getCurrent(void);
|
||||
|
||||
extern int AUD_isJackSupported(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -122,7 +122,9 @@ void KX_SoundActuator::play()
|
||||
break;
|
||||
}
|
||||
|
||||
//m_handle = AUD_Device_play(BKE_sound_get_device(), sound, false);
|
||||
AUD_Device* device = AUD_Device_getCurrent();
|
||||
m_handle = AUD_Device_play(device, sound, false);
|
||||
AUD_Device_free(device);
|
||||
|
||||
// in case of pingpong, we have to free the sound
|
||||
if(sound != m_sound)
|
||||
|
||||
Reference in New Issue
Block a user