From 59a6fd1ed8190c5c7f2e785bc013c2a209a02457 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 26 Jun 2011 01:06:07 +0200 Subject: [PATCH] #348: (continued) Missing sound files not reported properly Avoid useless "File '' not found." messages for missing sound files. --- simgear/sound/xmlsound.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simgear/sound/xmlsound.cxx b/simgear/sound/xmlsound.cxx index 0c54798f..3e90752e 100644 --- a/simgear/sound/xmlsound.cxx +++ b/simgear/sound/xmlsound.cxx @@ -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 ); -- 2.39.5