From fe86a9ed026b876d34adf0965b7e958c96a13bd7 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Wed, 21 Nov 2012 20:17:58 +0100 Subject: [PATCH] Fix compiler error with disabled sound support. ("source" is undefined in SGSampleGroup::stop). Also fixes two related compiler warnings (unused var "sample"). --- simgear/sound/sample_group.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/simgear/sound/sample_group.cxx b/simgear/sound/sample_group.cxx index eac28319..33cf2bce 100644 --- a/simgear/sound/sample_group.cxx +++ b/simgear/sound/sample_group.cxx @@ -295,8 +295,8 @@ SGSampleGroup::stop () alSourceStop( source ); testForALError("stop"); } -#endif _smgr->release_source( source ); +#endif sample->no_valid_source(); } @@ -316,8 +316,8 @@ SGSampleGroup::suspend () sample_map_iterator sample_current = _samples.begin(); sample_map_iterator sample_end = _samples.end(); for ( ; sample_current != sample_end; ++sample_current ) { - SGSoundSample *sample = sample_current->second; #ifdef ENABLE_SOUND + SGSoundSample *sample = sample_current->second; if ( sample->is_valid_source() && sample->is_playing() ) { alSourcePause( sample->get_source() ); } @@ -332,17 +332,17 @@ void SGSampleGroup::resume () { if (_active && _pause == true) { +#ifdef ENABLE_SOUND sample_map_iterator sample_current = _samples.begin(); sample_map_iterator sample_end = _samples.end(); for ( ; sample_current != sample_end; ++sample_current ) { SGSoundSample *sample = sample_current->second; -#ifdef ENABLE_SOUND if ( sample->is_valid_source() && sample->is_playing() ) { alSourcePlay( sample->get_source() ); } -#endif } testForALError("resume"); +#endif _pause = false; } } -- 2.39.5