]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/soundmgr.cxx
Updated --help message.
[flightgear.git] / src / Sound / soundmgr.cxx
index a1caaf6ffb6356b6444b1accf586cd5af34ca384..834632fbac75c3dd628929d2fe4eeb7941e28b4a 100644 (file)
@@ -64,14 +64,18 @@ FGSimpleSound::~FGSimpleSound() {
 // constructor
 FGSoundMgr::FGSoundMgr() {
     audio_sched = new slScheduler( 8000 );
-    audio_sched -> setMaxConcurrent ( 6 ); 
+    if ( audio_sched->notWorking() ) {
+       SG_LOG( SG_GENERAL, SG_ALERT, "Audio initialization failed!" );
+    } else {
+       audio_sched -> setMaxConcurrent ( 6 ); 
 
-    audio_mixer = new smMixer;
+       audio_mixer = new smMixer;
 
-    SG_LOG( SG_GENERAL, SG_INFO,
-           "Rate = " << audio_sched->getRate()
-           << "  Bps = " << audio_sched->getBps()
-           << "  Stereo = " << audio_sched->getStereo() );
+       SG_LOG( SG_GENERAL, SG_INFO,
+               "Rate = " << audio_sched->getRate()
+               << "  Bps = " << audio_sched->getBps()
+               << "  Stereo = " << audio_sched->getStereo() );
+    }
 }
 
 // destructor
@@ -172,22 +176,6 @@ bool FGSoundMgr::remove( const string& refname ) {
                                        NULL,
                                        SL_VOLUME_ENVELOPE );
 
-#if defined ( PLIB_1_2_X )
-       // if PLIB_1_2_X, we can't reliably remove sounds
-       // that are currently being played. :-( So, let's just not
-       // remove them and return false.  The effects of this are that
-       // the sound sample will continue to finish playing (or
-       // continue to loop forever.)  And the sound sample will
-       // remain registered in the plib audio system.  This is a
-       // memory leak, and eventually this could cause us to max out
-       // the total number of allowed sound samples in plib, but what
-       // are you going to do?  Hopefully the plib team will do a new
-       // stable relase with these problems fixed.
-
-       // cout << "plib broken audio, skipping actual remove" << endl;
-
-       return false;
-#else
        // must call audio_sched->update() after stopping the sound
        // but before deleting it.
        audio_sched -> update();
@@ -198,7 +186,6 @@ bool FGSoundMgr::remove( const string& refname ) {
         sounds.erase( it );
 
        return true;
-#endif
    } else {
        return false;
     }