Index: code/branches/presentation2/src/orxonox/sound/SoundBuffer.cc
===================================================================
--- code/branches/presentation2/src/orxonox/sound/SoundBuffer.cc	(revision 6331)
+++ code/branches/presentation2/src/orxonox/sound/SoundBuffer.cc	(revision 6332)
@@ -33,4 +33,6 @@
 #include <vorbis/vorbisfile.h>
 
+#include "util/Clock.h"
+#include "core/Game.h"
 #include "util/Exception.h"
 #include "util/StringUtils.h"
@@ -40,7 +42,8 @@
 namespace orxonox
 {
-    SoundBuffer::SoundBuffer(const std::string& filename)
+    SoundBuffer::SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer> >::iterator poolIterator)
         : filename_(filename)
         , audioBuffer_(AL_NONE)
+        , poolIterator_(poolIterator)
     {
         if (this->filename_.empty())
@@ -60,6 +63,9 @@
         if (getLowercase(extension) == "ogg")
         {
+            int before = Game::getInstance().getGameClock().getRealMicroseconds();
             // Try ogg loader
             this->loadOgg(fileInfo, dataStream);
+            int after = Game::getInstance().getGameClock().getRealMicroseconds();
+            COUT(0) << filename << ": " << (after - before) << std::endl;
         }
         else
@@ -80,8 +86,5 @@
         ALint size;
         alGetBufferi(this->audioBuffer_, AL_SIZE, &size);
-        if (!alGetError())
-            return size;
-        else
-            return 0;
+        return alGetError() ? 0 : size;
     }
 
@@ -108,12 +111,18 @@
     {
         Ogre::DataStream* stream = static_cast<Ogre::DataStream*>(datasource);
-        int offset_beg = offset;
-        if (whence == SEEK_CUR)
-            offset_beg = stream->tell() + offset;
-        else if (whence == SEEK_END)
-            offset_beg = stream->size() + offset;
-        else if (whence != SEEK_SET)
+        switch (whence)
+        {
+        case SEEK_SET:
+            stream->seek(offset);
+            break;
+        case SEEK_CUR:
+            stream->skip(offset);
+            break;
+        case SEEK_END:
+            stream->seek(stream->size() + offset);
+            break;
+        default:
             return -1;
-        stream->seek(offset_beg);
+        }
         return 0;
     }
Index: code/branches/presentation2/src/orxonox/sound/SoundBuffer.h
===================================================================
--- code/branches/presentation2/src/orxonox/sound/SoundBuffer.h	(revision 6331)
+++ code/branches/presentation2/src/orxonox/sound/SoundBuffer.h	(revision 6332)
@@ -42,9 +42,9 @@
     {
         friend class SoundManager;
+        // Make sure nobody deletes an instance (using smart pointers)
+        template <class T>
+        friend void boost::checked_delete(T*);
 
     public:
-        SoundBuffer(const std::string& filename);
-        ~SoundBuffer();
-
         inline ALuint getBuffer()
             { return this->audioBuffer_; }
@@ -55,10 +55,7 @@
             { return this->filename_; }
 
-        void setPooling(bool val)
-            { this->bPooling_ = true; }
-        bool getPooling() const
-            { return this->bPooling_; }
-
     private:
+        SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer> >::iterator poolIterator);
+        ~SoundBuffer();
         void loadStandard(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
         void loadOgg(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
@@ -67,5 +64,4 @@
         ALuint audioBuffer_;
         std::list<shared_ptr<SoundBuffer> >::iterator poolIterator_;
-        bool bPooling_;
     };
 }
Index: code/branches/presentation2/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/presentation2/src/orxonox/sound/SoundManager.cc	(revision 6331)
+++ code/branches/presentation2/src/orxonox/sound/SoundManager.cc	(revision 6332)
@@ -60,10 +60,11 @@
         Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit);
 
+/*
         // Get list of available sound devices and display them
-/*        const char* devices = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
+        const char* devices = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
         char* device = new char[strlen(devices)+1];
         strcpy(device, devices);
         std::string renderDevice;
-//        SetConfigValue(renderDevice, std::string(device)).description("Sound device used for rendering");
+        SetConfigValue(renderDevice, std::string(device)).description("Sound device used for rendering");
         COUT(4) << "Sound: Available devices: ";
         while (true)
@@ -79,5 +80,6 @@
         // Open the selected device
         COUT(3) << "Sound: Opening device \"" << renderDevice << "\"" << std::endl;
-        this->device_ = alcOpenDevice(renderDevice.c_str());*/
+        this->device_ = alcOpenDevice(renderDevice.c_str());
+*/
         this->device_ = alcOpenDevice(NULL);
         if (this->device_ == NULL)
@@ -573,6 +575,5 @@
             try
             {
-                buffer.reset(new SoundBuffer(filename));
-                buffer->poolIterator_ = this->effectsPool_.end();
+                buffer.reset(new SoundBuffer(filename, this->effectsPool_.end()));
             }
             catch (...)
Index: code/branches/presentation2/src/orxonox/sound/SoundManager.h
===================================================================
--- code/branches/presentation2/src/orxonox/sound/SoundManager.h	(revision 6331)
+++ code/branches/presentation2/src/orxonox/sound/SoundManager.h	(revision 6332)
@@ -92,8 +92,8 @@
         void unregisterAmbientSound(AmbientSound* oldAmbient);
         void pauseAmbientSound(AmbientSound* ambient);
-        
+
         void setVolume(float vol, SoundType::Value type);
         float getVolume(SoundType::Value type); // tolua_export
-        
+
         void toggleMute(SoundType::Value type); // tolua_export
         bool getMute(SoundType::Value type); // tolua_export
@@ -117,9 +117,9 @@
         void checkAmbientVolumeValidity(void);
         void checkEffectsVolumeValidity(void);
-        
+
         float checkVolumeRange(float vol);
-        
+
         void updateVolume(SoundType::Value type);
-        
+
         void setVolumeInternal(float vol, SoundType::Value type);
         float getVolumeInternal(SoundType::Value type);
@@ -128,12 +128,12 @@
         ALCdevice* device_;
         ALCcontext* context_;
-       
+
         typedef std::list<std::pair<AmbientSound*, bool> > AmbientList;
         AmbientList ambientSounds_;
-        
+
         float crossFadeStep_;       //!< Absolute change per second (0.1 means 10% of the nominal volume) for cross fading
         std::list<AmbientSound*> fadeInList_;
         std::list<AmbientSound*> fadeOutList_;
-        
+
         float soundVolume_;
         float ambientVolume_;
@@ -150,5 +150,5 @@
         unsigned int maxSources_;
         std::vector<ALuint> soundSources_;
-        
+
         static SoundManager* singletonPtr_s;
     }; // tolua_export
