[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31376] trunk/blender/intern/audaspace: Audaspace:

Joerg Mueller nexyon at gmail.com
Mon Aug 16 15:13:05 CEST 2010


Revision: 31376
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31376
Author:   nexyon
Date:     2010-08-16 15:13:05 +0200 (Mon, 16 Aug 2010)

Log Message:
-----------
Audaspace:
* Fix for uncached exception whith invalid audio file.
* Includes fix for windows.

Modified Paths:
--------------
    trunk/blender/intern/audaspace/Python/AUD_PyAPI.cpp
    trunk/blender/intern/audaspace/intern/AUD_C-API.cpp

Modified: trunk/blender/intern/audaspace/Python/AUD_PyAPI.cpp
===================================================================
--- trunk/blender/intern/audaspace/Python/AUD_PyAPI.cpp	2010-08-16 12:27:51 UTC (rev 31375)
+++ trunk/blender/intern/audaspace/Python/AUD_PyAPI.cpp	2010-08-16 13:13:05 UTC (rev 31376)
@@ -58,9 +58,6 @@
 #include "AUD_JackDevice.h"
 #endif
 
-#include <cstdlib>
-#include <unistd.h>
-
 // ====================================================================
 
 typedef enum

Modified: trunk/blender/intern/audaspace/intern/AUD_C-API.cpp
===================================================================
--- trunk/blender/intern/audaspace/intern/AUD_C-API.cpp	2010-08-16 12:27:51 UTC (rev 31375)
+++ trunk/blender/intern/audaspace/intern/AUD_C-API.cpp	2010-08-16 13:13:05 UTC (rev 31376)
@@ -244,20 +244,23 @@
 {
 	assert(sound);
 
-	AUD_IReader* reader = sound->createReader();
-
 	AUD_SoundInfo info;
+	info.specs.channels = AUD_CHANNELS_INVALID;
+	info.specs.rate = AUD_RATE_INVALID;
+	info.length = 0.0f;
 
-	if(reader)
+	try
 	{
-		info.specs = reader->getSpecs();
-		info.length = reader->getLength() / (float) info.specs.rate;
+		AUD_IReader* reader = sound->createReader();
+
+		if(reader)
+		{
+			info.specs = reader->getSpecs();
+			info.length = reader->getLength() / (float) info.specs.rate;
+		}
 	}
-	else
+	catch(AUD_Exception&)
 	{
-		info.specs.channels = AUD_CHANNELS_INVALID;
-		info.specs.rate = AUD_RATE_INVALID;
-		info.length = 0.0f;
 	}
 
 	return info;





More information about the Bf-blender-cvs mailing list