]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/voice.cxx
Interim windows build fix
[flightgear.git] / src / Sound / voice.cxx
index 04f8c4ef7956c82c4e56502f6e04b016a38d76f8..8817efe812ce511c278df9f1f3641317a63dd1b7 100644 (file)
@@ -93,19 +93,18 @@ void FGVoiceMgr::init()
     SGPropertyNode_ptr voice = voices[i];
     if( voice->getBoolValue("festival", false ) ) {
       try {
-        SG_LOG(SG_ALL,SG_ALERT,"creating festival voice" );
         _voices.push_back(new FGFestivalVoice(this, voice));
-      } catch (const std::string& s) {
-        SG_LOG(SG_SOUND, SG_ALERT, "VOICE: " << s);
+        continue;
+      } catch (const std::string& ) {
+        SG_LOG(SG_SOUND, SG_WARN, "failed to create festival voice, falling back to flite voice" );
       }
-    } else {
+    }
 #if defined(ENABLE_FLITE)
-      SG_LOG(SG_ALL,SG_ALERT,"creating flite voice" );
-      _voices.push_back(new FGFLITEVoice(this, voice));
+    SG_LOG(SG_SOUND,SG_INFO,"creating flite voice" );
+    _voices.push_back(new FGFLITEVoice(this, voice));
 #else
-      SG_LOG(SG_ALL,SG_ALERT,"non festival voice not supported." );
+    SG_LOG(SG_SOUND,SG_ALERT,"non festival voice not supported." );
 #endif
-    }
   }
 
 #if defined(ENABLE_THREADS)
@@ -117,10 +116,12 @@ void FGVoiceMgr::init()
 void FGVoiceMgr::shutdown()
 {
 #if defined(ENABLE_THREADS)
-  _thread->cancel();
-  _thread->join();
-  delete _thread;
-  _thread = NULL;
+  if( _thread ) {
+    _thread->cancel();
+    _thread->join();
+    delete _thread;
+    _thread = NULL;
+  }
 #endif
 
   for( std::vector<FGVoice*>::iterator it = _voices.begin(); it != _voices.end(); ++it )