]> git.mxchange.org Git - simgear.git/commitdiff
Fix compiler error with disabled sound support.
authorThorstenB <brehmt@gmail.com>
Wed, 21 Nov 2012 19:17:58 +0000 (20:17 +0100)
committerThorstenB <brehmt@gmail.com>
Wed, 21 Nov 2012 19:17:58 +0000 (20:17 +0100)
("source" is undefined in SGSampleGroup::stop).
Also fixes two related compiler warnings (unused var "sample").

simgear/sound/sample_group.cxx

index eac283195ff209e48f14adc7f694e6299542e002..33cf2bce4541e13d8caa61deb8fc57aee8948818 100644 (file)
@@ -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;
     }
 }