comparison src/audio/arts/SDL_artsaudio.c @ 929:03fb90fc135e

Date: Mon, 05 Jul 2004 14:37:59 +0200 From: Yves Maurischat Subject: [SDL] Crashes when using aRts on Linux We had a problem with my app using SDL. It always crashed after SDL_OpenAudio(), if the artsd was running on a Linux machine with KDE. After some investigation (and searching for differences in other apps using arts) we found out, that the problem resulted from loading, calling arts_init(), calling arts_free() and unloading the aRts-Library in .../src/audio/arts/SDL_artsaudio.c twice: first in "static int Audio_Available()", the second time in "static SDL_AudioDevice *Audio_CreateDevice(int devindex)".
author Sam Lantinga <slouken@libsdl.org>
date Wed, 18 Aug 2004 21:41:39 +0000
parents 0c892e99b65b
children 4263beff9e38
comparison
equal deleted inserted replaced
928:6c87754f324c 929:03fb90fc135e
138 138
139 if ( LoadARTSLibrary() < 0 ) { 139 if ( LoadARTSLibrary() < 0 ) {
140 return available; 140 return available;
141 } 141 }
142 if ( SDL_NAME(arts_init)() == 0 ) { 142 if ( SDL_NAME(arts_init)() == 0 ) {
143 #define ARTS_CRASH_HACK /* Play a stream so aRts doesn't crash */
144 #ifdef ARTS_CRASH_HACK
145 arts_stream_t stream2;
146 stream2=SDL_NAME(arts_play_stream)(44100, 16, 2, "SDL");
147 SDL_NAME(arts_write)(stream2, "", 0);
148 SDL_NAME(arts_close_stream)(stream2);
149 #endif
143 available = 1; 150 available = 1;
144 SDL_NAME(arts_free)(); 151 SDL_NAME(arts_free)();
145 } 152 }
146 UnloadARTSLibrary(); 153 UnloadARTSLibrary();
147 154