]> git.mxchange.org Git - simgear.git/commitdiff
#348: (continued) Missing sound files not reported properly
authorThorstenB <brehmt@gmail.com>
Sat, 25 Jun 2011 23:06:07 +0000 (01:06 +0200)
committerThorstenB <brehmt@gmail.com>
Sat, 25 Jun 2011 23:06:07 +0000 (01:06 +0200)
Avoid useless "File '' not found." messages for missing sound files.

simgear/sound/xmlsound.cxx

index 0c54798f7562612a854a63bd2676bb4b816de321..3e90752ea3f8e9f7a7a6f7bb7993152b336aaf0a 100644 (file)
@@ -273,9 +273,10 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node,
    } else {
       _sgrp = sgrp;
    }
-   _sample = new SGSoundSample(node->getStringValue("path", ""), currentDir);
+   string soundFileStr = node->getStringValue("path", "");
+   _sample = new SGSoundSample(soundFileStr.c_str(), currentDir);
    if (!_sample->file_path().exists()) {
-      throw sg_io_exception("XML sound: couldn't find file: " + _sample->file_path().str());
+      throw sg_io_exception("XML sound: couldn't find file: '" + soundFileStr + "'");
    }
    
    _sample->set_relative_position( offset_pos );