X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Faudio%2Fsound_file.cpp;h=98a615b148aa3941c9c69f703765d2cac696fde1;hb=6b0c80bde84af0bf9323320d99f2fccd7c9eeedd;hp=2495bbbb0d6acd1e9426d5b6615bd3b419ccd9fd;hpb=a02b3fd87f0da4bc4bdec0491eefe6186f817846;p=supertux.git diff --git a/src/audio/sound_file.cpp b/src/audio/sound_file.cpp index 2495bbbb0..98a615b14 100644 --- a/src/audio/sound_file.cpp +++ b/src/audio/sound_file.cpp @@ -398,9 +398,13 @@ SoundFile* load_sound_file(const std::string& filename) PHYSFS_file* file = PHYSFS_openRead(filename.c_str()); if(!file) { + log_warning << "Couldn't open '" << filename << "': " << PHYSFS_getLastError() << ", using dummy sound file." << std::endl; + file = PHYSFS_openRead("sounds/empty.wav"); + if (!file) { std::stringstream msg; - msg << "Couldn't open '" << filename << "': " << PHYSFS_getLastError(); - throw std::runtime_error(msg.str()); + msg << "Couldn't open dummy sound file '" << filename << "': " << PHYSFS_getLastError(); + throw std::runtime_error(msg.str()); + } } try {