Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-11-09 13:28:23 +0000
committerStijn Buys <ingar@osirion.org>2010-11-09 13:28:23 +0000
commit7c024e9101a63be34a2c97ef0dc18deaa1afb175 (patch)
treedc604d5578efa98ba8164c5492ce20f2848f646a /src/audio/buffers.cc
parentfdcff7183b035a27ff960f347b9975ab8e67a3cd (diff)
prevent error message spam if the audio subsystem can not initialize itself
Diffstat (limited to 'src/audio/buffers.cc')
-rw-r--r--src/audio/buffers.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/audio/buffers.cc b/src/audio/buffers.cc
index 7bf7eb1..4349e8f 100644
--- a/src/audio/buffers.cc
+++ b/src/audio/buffers.cc
@@ -1,11 +1,12 @@
/*
- audio/buffers.h
+ audio/buffers.cc
This file is part of the Osirion project and is distributed under
the terms of the GNU General Public License version 2
*/
#include <string.h>
+#include "audio/audio.h"
#include "audio/buffers.h"
#include "audio/pcm.h"
#include "audio/wav.h"
@@ -59,6 +60,12 @@ size_t Buffers::load(std::string name)
if (it != registry.end())
return (*it).second;
+ // check if the audio subsystem has been initialized
+ if (!initialized()) {
+ registry[name] = 0;
+ return 0;
+ }
+
// load wav file
PCM *pcm = Wav::load(name);
if (!pcm) {