Slightly rearrange the buffer removing code. This should make sure the source is always stopped (required by the OpenAL spec) before a buffer is removed and added to the free source list.
This commit is contained in:
parent
0a08ee836c
commit
3c9fec78fa
@ -94,12 +94,19 @@ void SGSampleGroup::update( double dt ) {
|
||||
ALint result = AL_STOPPED;
|
||||
|
||||
if ( sample->is_valid_source() ) {
|
||||
int source = sample->get_source();
|
||||
|
||||
alGetSourcei( source, AL_SOURCE_STATE, &result );
|
||||
if ( sample->is_looping() ) {
|
||||
sample->no_valid_source();
|
||||
_smgr->release_source( sample->get_source() );
|
||||
if ( result != AL_STOPPED ) {
|
||||
alSourceStop( source );
|
||||
alGetSourcei( source, AL_SOURCE_STATE, &result );
|
||||
}
|
||||
if ( result == AL_STOPPED ) {
|
||||
sample->no_valid_source();
|
||||
_smgr->release_source( sample->get_source() );
|
||||
}
|
||||
}
|
||||
else
|
||||
alGetSourcei( sample->get_source(), AL_SOURCE_STATE, &result );
|
||||
}
|
||||
|
||||
if ( result == AL_STOPPED ) {
|
||||
|
Loading…
Reference in New Issue
Block a user