src/audio/SDL_audio.c
changeset 1190 173c063d4f55
parent 955 d74fbf56f2f6
child 1204 f9794ee91dfc
--- a/src/audio/SDL_audio.c	Wed Nov 23 07:23:48 2005 +0000
+++ b/src/audio/SDL_audio.c	Wed Nov 23 07:29:56 2005 +0000
@@ -38,6 +38,12 @@
 #include "SDL_audiomem.h"
 #include "SDL_sysaudio.h"
 
+#ifdef __OS2__
+// We'll need the DosSetPriority() API!
+#define INCL_DOSPROCESS
+#include <os2.h>
+#endif
+
 /* Available audio drivers */
 static AudioBootStrap *bootstrap[] = {
 #ifdef OPENBSD_AUDIO_SUPPORT
@@ -108,6 +114,9 @@
 #ifdef DRENDERER_SUPPORT
 	&DRENDERER_bootstrap,
 #endif
+#ifdef __OS2__
+        &DART_bootstrap,
+#endif
 	NULL
 };
 SDL_AudioDevice *current_audio = NULL;
@@ -181,6 +190,16 @@
 	D(bug("Entering audio loop...\n"));
 #endif
 
+#ifdef __OS2__
+        // Increase the priority of this thread to make sure that
+        // the audio will be continuous all the time!
+#ifdef USE_DOSSETPRIORITY
+#ifdef DEBUG_BUILD
+        printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID());
+#endif
+        DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0);
+#endif
+#endif
 
 	/* Loop, filling the audio buffers */
 	while ( audio->enabled ) {
@@ -249,6 +268,11 @@
 	D(bug("CloseAudio..Done, subtask exiting...\n"));
 	audio_configured = 0;
 #endif
+#ifdef __OS2__
+#ifdef DEBUG_BUILD
+        printf("[SDL_RunAudio] : Task exiting. (TID%d)\n", SDL_ThreadID());
+#endif
+#endif
 	return(0);
 }