[Orxonox-commit 549] r3092 - trunk/src/orxonox/sound

rgrieder at orxonox.net rgrieder at orxonox.net
Wed May 27 21:37:12 CEST 2009


Author: rgrieder
Date: 2009-05-27 21:37:12 +0200 (Wed, 27 May 2009)
New Revision: 3092

Modified:
   trunk/src/orxonox/sound/SoundManager.cc
Log:
SoundManager.cc: alutGetMIMETypes might return NULL instead of const char* --> Display error and don't feed NULL-string or all hell might break loose.

Modified: trunk/src/orxonox/sound/SoundManager.cc
===================================================================
--- trunk/src/orxonox/sound/SoundManager.cc	2009-05-27 19:35:51 UTC (rev 3091)
+++ trunk/src/orxonox/sound/SoundManager.cc	2009-05-27 19:37:12 UTC (rev 3092)
@@ -52,7 +52,11 @@
         else
         {
             COUT(4) << "Sound: OpenAL ALUT version: " << alutGetMajorVersion() << "." << alutGetMinorVersion() << std::endl;
-            COUT(4) << "Sound: OpenAL ALUT supported MIME types: " << alutGetMIMETypes(ALUT_LOADER_BUFFER) << std::endl;
+            const char* str = alutGetMIMETypes(ALUT_LOADER_BUFFER);
+            if (str == NULL)
+                COUT(2) << "Sound: OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl;
+            else
+                COUT(4) << "Sound: OpenAL ALUT supported MIME types: " << str << std::endl;
             if(SoundManager::device_s == NULL)
             {
                 COUT(3) << "Sound: OpenAL: Open sound device..." << std::endl;




More information about the Orxonox-commit mailing list