X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fsound%2Fsample_group.cxx;h=1610d088fbfabb3871d290ad5670866ee36e81fa;hb=bcb320b537b6f7e5e3724e8a30d309322171eb43;hp=99a5a0eb3689fa40b398e97d0fe3ad98f08d8b69;hpb=8a5a1d33019835a648b34d18f0b7d5fc2e4032fc;p=simgear.git diff --git a/simgear/sound/sample_group.cxx b/simgear/sound/sample_group.cxx index 99a5a0eb..1610d088 100644 --- a/simgear/sound/sample_group.cxx +++ b/simgear/sound/sample_group.cxx @@ -134,13 +134,14 @@ void SGSampleGroup::update( double dt ) { ALuint source = _smgr->request_source(); if (alIsSource(source) == AL_TRUE ) { + ALboolean looping = sample->is_looping() ? AL_TRUE : AL_FALSE; if ( sample->is_queue() ) { sample->set_source( source ); update_sample_config( sample ); alSourcef( source, AL_ROLLOFF_FACTOR, 0.3 ); - alSourcei( source, AL_LOOPING, AL_FALSE); + alSourcei( source, AL_LOOPING, looping ); alSourcei( source, AL_SOURCE_RELATIVE, AL_FALSE ); alSourcePlay( source ); testForALError("sample play"); @@ -154,15 +155,12 @@ void SGSampleGroup::update( double dt ) { ALuint buffer = sample->get_buffer(); if ( alIsBuffer(buffer) == AL_TRUE ) { - ALboolean looping; - alSourcei( source, AL_BUFFER, buffer ); testForALError("assign buffer to source"); sample->set_source( source ); update_sample_config( sample ); - looping = sample->is_looping() ? AL_TRUE : AL_FALSE; alSourcei( source, AL_LOOPING, looping ); alSourcef( source, AL_ROLLOFF_FACTOR, 0.3 ); alSourcei( source, AL_SOURCE_RELATIVE, AL_FALSE ); @@ -275,7 +273,6 @@ SGSampleGroup::stop () ALint source = sample->get_source(); if ( sample->is_playing() ) { alSourceStop( source ); - alSourcei( source, AL_BUFFER, 0 ); } _smgr->release_source( source ); sample->no_valid_source();