[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25188] trunk/blender/source: -noaudio option to force the sound system to None.
Martin Poirier
theeth at yahoo.com
Mon Dec 7 21:39:57 CET 2009
Revision: 25188
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25188
Author: theeth
Date: 2009-12-07 21:39:57 +0100 (Mon, 07 Dec 2009)
Log Message:
-----------
-noaudio option to force the sound system to None.
Useful when openAL is not setup properly (*cough* pulseaudio *cough) and prevents startup.
This doesn't actually affect the userpref option, so you can set it to whatever you want, save userprefs and restart.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/BKE_sound.h
trunk/blender/source/blender/blenkernel/intern/sound.c
trunk/blender/source/creator/creator.c
Modified: trunk/blender/source/blender/blenkernel/BKE_sound.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_sound.h 2009-12-07 20:38:09 UTC (rev 25187)
+++ trunk/blender/source/blender/blenkernel/BKE_sound.h 2009-12-07 20:39:57 UTC (rev 25188)
@@ -41,6 +41,8 @@
void sound_exit();
+void sound_disable();
+
struct bSound* sound_new_file(struct Main *main, char* filename);
// XXX unused currently
Modified: trunk/blender/source/blender/blenkernel/intern/sound.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sound.c 2009-12-07 20:38:09 UTC (rev 25187)
+++ trunk/blender/source/blender/blenkernel/intern/sound.c 2009-12-07 20:39:57 UTC (rev 25188)
@@ -31,6 +31,13 @@
#include <config.h>
#endif
+static int sound_disabled = 0;
+
+void sound_disable()
+{
+ sound_disabled = 1;
+}
+
void sound_init()
{
AUD_Specs specs;
@@ -42,6 +49,9 @@
specs.format = U.audioformat;
specs.rate = U.audiorate;
+ if (sound_disabled)
+ device = 0;
+
if(buffersize < 128)
buffersize = AUD_DEFAULT_BUFFER_SIZE;
Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c 2009-12-07 20:38:09 UTC (rev 25187)
+++ trunk/blender/source/creator/creator.c 2009-12-07 20:39:57 UTC (rev 25188)
@@ -62,6 +62,7 @@
#include "BKE_scene.h"
#include "BKE_node.h"
#include "BKE_report.h"
+#include "BKE_sound.h"
#include "IMB_imbuf.h" // for quicktime_init
@@ -219,6 +220,7 @@
printf (" -d\t\tTurn debugging on\n");
printf (" -nojoystick\tDisable joystick support\n");
printf (" -noglsl\tDisable GLSL shading\n");
+ printf (" -noaudio\tForce sound system to None\n");
printf (" -h\t\tPrint this help text\n");
printf (" -y\t\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)\n");
printf (" -P <filename>\tRun the given Python script (filename or Blender Text)\n");
@@ -482,8 +484,10 @@
SYS_WriteCommandLineInt(syshandle,"nojoystick",1);
if (G.f & G_DEBUG) printf("disabling nojoystick\n");
}
- if (BLI_strcasecmp(argv[a], "-noglsl") == 0)
+ else if (BLI_strcasecmp(argv[a], "-noglsl") == 0)
GPU_extensions_disable();
+ else if (BLI_strcasecmp(argv[a], "-noaudio") == 0)
+ sound_disable();
break;
}
}
More information about the Bf-blender-cvs
mailing list