diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-10-19 10:12:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-10-19 10:12:11 +0400 |
commit | c6d1ac3af8af4c074228b74157be9d9addf16ea7 (patch) | |
tree | b858ed9fad5bf63df52bcb3b3ab27b2ddb284b98 /source | |
parent | 42e287af1cc3ed2f37630f6f62c82c2d8ccc66b3 (diff) |
only set the SDL audio driver to alsa when not running in background mode and when blender is compiled with SDL.
Diffstat (limited to 'source')
-rw-r--r-- | source/creator/SConscript | 3 | ||||
-rw-r--r-- | source/creator/creator.c | 19 |
2 files changed, 16 insertions, 6 deletions
diff --git a/source/creator/SConscript b/source/creator/SConscript index a4c218f89d6..15f73040f4b 100644 --- a/source/creator/SConscript +++ b/source/creator/SConscript @@ -22,4 +22,7 @@ if env['WITH_BF_BINRELOC']==1: if env['WITH_BF_OPENEXR']==1: defs.append('WITH_OPENEXR') +if not env['WITH_BF_SDL']: + defs.append('DISABLE_SDL') + env.BlenderLib ( libname = 'blender_creator', sources = Split(sources), includes = Split(incs), defines = defs, libtype='core', priority = 1 ) diff --git a/source/creator/creator.c b/source/creator/creator.c index 38c37575bd1..b5360b31a0a 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -237,9 +237,11 @@ static void print_help(void) printf (" $TEMP\t\tStore temporary files here.\n"); #else printf (" $TMP or $TMPDIR\tStore temporary files here.\n"); - printf (" $SDL_AUDIODRIVER\tLibSDL audio driver - alsa, esd, alsa, dma.\n"); printf (" $BF_TIFF_LIB\t\tUse an alternative libtiff.so for loading tiff image files.\n"); #endif +#ifndef DISABLE_SDL + printf (" $SDL_AUDIODRIVER\tLibSDL audio driver - alsa, esd, alsa, dma.\n"); +#endif printf (" $IMAGEEDITOR\t\tImage editor executable, launch with the IKey from the file selector.\n"); printf (" $WINEDITOR\t\tText editor executable, launch with the EKey from the file selector.\n"); printf (" $PYTHONHOME\t\tPath to the python directory, eg. /usr/lib/python.\n"); @@ -326,10 +328,6 @@ int main(int argc, char **argv) #ifdef __linux__ #ifdef __alpha__ signal (SIGFPE, fpe_handler); - #else - if ( getenv("SDL_AUDIODRIVER") == NULL) { - setenv("SDL_AUDIODRIVER", "alsa", 1); - } #endif #endif #if defined(__sgi) @@ -432,7 +430,7 @@ int main(int argc, char **argv) /* for all platforms, even windos has it! */ if(G.background) signal(SIGINT, blender_esc); /* ctrl c out bg render */ - + /* background render uses this font too */ BKE_font_register_builtin(datatoc_Bfont, datatoc_Bfont_size); @@ -530,6 +528,15 @@ int main(int argc, char **argv) BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */ +#ifndef DISABLE_SDL +#ifdef __linux__ + /* On linux the default SDL driver dma often would not play + * use alsa if none is set */ + if ( getenv("SDL_AUDIODRIVER") == NULL) { + setenv("SDL_AUDIODRIVER", "alsa", 1); + } +#endif +#endif } else { BPY_start_python(argc, argv); |