Index: /trunk/src/lib/sound/ogg_player.cc
===================================================================
--- /trunk/src/lib/sound/ogg_player.cc	(revision 6841)
+++ /trunk/src/lib/sound/ogg_player.cc	(revision 6842)
@@ -35,10 +35,13 @@
   this->setClassID(CL_SOUND_OGG_PLAYER, "OggPlayer");
 
+  this->trackLoaded = false;
   this->source = 0;
+  this->buffers[0] = 0;
+  this->buffers[1] = 0;
 
   if (fileName != NULL)
   {
-    this->open(fileName);
-    this->setName(fileName);
+    if (this->open(fileName))
+      this->setName(fileName);
   }
 }
@@ -48,6 +51,19 @@
  * @param fileName the file to open
  */
-void OggPlayer::open(const char* fileName)
-{
+bool OggPlayer::open(const char* fileName)
+{
+  if (this->buffers[0] == 0)
+    alGenBuffers(2, this->buffers);
+  SoundEngine::checkError("Allocating Buffers", __LINE__);
+
+  if (this->source == 0)
+    SoundEngine::getInstance()->popALSource(this->source);
+  if (this->source == 0)
+  {
+    this->trackLoaded = false;
+    return false;
+  }
+  printf("OK\n");
+
   int result;
 
@@ -69,10 +85,4 @@
   else
     format = AL_FORMAT_STEREO16;
-
-
-  alGenBuffers(2, buffers);
-  check();
-  SoundEngine::getInstance()->popALSource(this->source);
-  check();
 
   alSource3f(source, AL_POSITION,        0.0, 0.0, 0.0);
@@ -82,4 +92,7 @@
   alSourcei (source, AL_SOURCE_RELATIVE, AL_TRUE      );
   alSourcef (source, AL_GAIN,            SoundEngine::getInstance()->getMusicVolume());
+
+  this->trackLoaded = true;
+  return true;
 }
 
@@ -92,9 +105,13 @@
   empty();
   SoundEngine::getInstance()->pushALSource(source);
+  this->source = 0;
   check();
-  alDeleteBuffers(1, buffers);
+  alDeleteBuffers(2, buffers);
+  this->buffers[0] = 0;
+  this->buffers[1] = 0;
   check();
 
   ov_clear(&oggStream);
+  this->trackLoaded = false;
 }
 
@@ -106,4 +123,7 @@
 bool OggPlayer::playback()
 {
+  if (!this->trackLoaded)
+    return false;
+
   if(playing())
     return true;
@@ -127,4 +147,6 @@
 bool OggPlayer::playing()
 {
+  if (!this->trackLoaded)
+    return false;
   ALenum state;
 
@@ -140,4 +162,7 @@
 bool OggPlayer::update()
 {
+  if (!this->trackLoaded)
+    return false;
+
   int processed;
   bool active = true;
@@ -233,13 +258,13 @@
 {
   cout
-      << "version         " << vorbisInfo->version         << "\n"
-      << "channels        " << vorbisInfo->channels        << "\n"
-      << "rate (hz)       " << vorbisInfo->rate            << "\n"
-      << "bitrate upper   " << vorbisInfo->bitrate_upper   << "\n"
-      << "bitrate nominal " << vorbisInfo->bitrate_nominal << "\n"
-      << "bitrate lower   " << vorbisInfo->bitrate_lower   << "\n"
-      << "bitrate window  " << vorbisInfo->bitrate_window  << "\n"
-      << "\n"
-      << "vendor " << vorbisComment->vendor << "\n";
+  << "version         " << vorbisInfo->version         << "\n"
+  << "channels        " << vorbisInfo->channels        << "\n"
+  << "rate (hz)       " << vorbisInfo->rate            << "\n"
+  << "bitrate upper   " << vorbisInfo->bitrate_upper   << "\n"
+  << "bitrate nominal " << vorbisInfo->bitrate_nominal << "\n"
+  << "bitrate lower   " << vorbisInfo->bitrate_lower   << "\n"
+  << "bitrate window  " << vorbisInfo->bitrate_window  << "\n"
+  << "\n"
+  << "vendor " << vorbisComment->vendor << "\n";
 
   for(int i = 0; i < vorbisComment->comments; i++)
Index: /trunk/src/lib/sound/ogg_player.h
===================================================================
--- /trunk/src/lib/sound/ogg_player.h	(revision 6841)
+++ /trunk/src/lib/sound/ogg_player.h	(revision 6842)
@@ -29,5 +29,5 @@
     OggPlayer(const char* fileName = NULL);
 
-    void open(const char* fileName);
+    bool open(const char* fileName);
     void release();
     void debug();
@@ -53,4 +53,5 @@
     ALuint              source;               //!< The source we play back on
     ALenum              format;               //!< The format we play back
+    bool                trackLoaded;          //!< If a Track has been loaded.
   };
 
Index: /trunk/src/lib/sound/sound_engine.cc
===================================================================
--- /trunk/src/lib/sound/sound_engine.cc	(revision 6841)
+++ /trunk/src/lib/sound/sound_engine.cc	(revision 6842)
@@ -337,6 +337,10 @@
 
     alGenSources(1, &source);
-    printf("%d %d\n", i, source);
     this->checkError("allocate Source", __LINE__);
+    if (!alIsSource(source))
+    {
+      PRINTF(2)("not allocated Source\n");
+      continue;
+    }
 
     alSourcef (source, AL_PITCH,    1.0      );
