From 0a2071b2f1bad1a3f82829675eec39f33e0a6ec0 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Tue, 15 Jan 2019 11:38:38 +0100 Subject: [PATCH] Use AAX_PROCESSED since AAX_STOPPED is only a request to stop but the library decides when it is actually stopped. And AeonWave has become more picky about destroying emitters which aren't completely processed yet since MIDI support was added. --- simgear/sound/soundmgr_aeonwave.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/simgear/sound/soundmgr_aeonwave.cxx b/simgear/sound/soundmgr_aeonwave.cxx index b25fe008..93ee0997 100644 --- a/simgear/sound/soundmgr_aeonwave.cxx +++ b/simgear/sound/soundmgr_aeonwave.cxx @@ -8,7 +8,7 @@ // Modified for the new SoundSystem by Erik Hofman, October 2009 // // Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt -// Copyright (C) 2009 Erik Hofman +// Copyright (C) 2009-2019 Erik Hofman // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -419,7 +419,7 @@ void SGSoundMgr::release_source( unsigned int source ) aax::Emitter& emitter = source_it->second; enum aaxState state = emitter.state(); if (state == AAX_PLAYING || state == AAX_SUSPENDED) { - TRY( emitter.set(AAX_STOPPED) ); + TRY( emitter.set(AAX_PROCESSED) ); TRY( d->_aax.remove(emitter) ); } TRY( emitter.remove_buffer() ); @@ -555,7 +555,6 @@ void SGSoundMgr::sample_play( SGSoundSample *sample ) if (bufid == SGSoundMgr::FAILED_BUFFER || bufid == SGSoundMgr::NO_BUFFER) { -printf("A: release: %i, bufid: %i (%i, %i)\n", sample->get_source(), bufid, SGSoundMgr::FAILED_BUFFER, SGSoundMgr::NO_BUFFER); release_source(sample->get_source()); return; } @@ -590,7 +589,7 @@ void SGSoundMgr::sample_stop( SGSoundSample *sample ) if ( sample->is_looping() && !stopped) { #ifdef ENABLE_SOUND aax::Emitter& emitter = d->get_emitter(source); - TRY( emitter.set(AAX_STOPPED) ); + TRY( emitter.set(AAX_PROCESSED) ); TRY( d->_aax.remove(emitter) ); #endif stopped = is_sample_stopped(sample); @@ -610,7 +609,7 @@ void SGSoundMgr::sample_destroy( SGSoundSample *sample ) unsigned int source = sample->get_source(); if ( sample->is_playing() ) { aax::Emitter& emitter = d->get_emitter(source); - TRY( emitter.set(AAX_STOPPED) ); + TRY( emitter.set(AAX_PROCESSED) ); TRY( d->_aax.remove(emitter) ); } release_source( source );