src/audio/SDL_audio.c
changeset 1190 173c063d4f55
parent 955 d74fbf56f2f6
child 1204 f9794ee91dfc
     1.1 --- a/src/audio/SDL_audio.c	Wed Nov 23 07:23:48 2005 +0000
     1.2 +++ b/src/audio/SDL_audio.c	Wed Nov 23 07:29:56 2005 +0000
     1.3 @@ -38,6 +38,12 @@
     1.4  #include "SDL_audiomem.h"
     1.5  #include "SDL_sysaudio.h"
     1.6  
     1.7 +#ifdef __OS2__
     1.8 +// We'll need the DosSetPriority() API!
     1.9 +#define INCL_DOSPROCESS
    1.10 +#include <os2.h>
    1.11 +#endif
    1.12 +
    1.13  /* Available audio drivers */
    1.14  static AudioBootStrap *bootstrap[] = {
    1.15  #ifdef OPENBSD_AUDIO_SUPPORT
    1.16 @@ -108,6 +114,9 @@
    1.17  #ifdef DRENDERER_SUPPORT
    1.18  	&DRENDERER_bootstrap,
    1.19  #endif
    1.20 +#ifdef __OS2__
    1.21 +        &DART_bootstrap,
    1.22 +#endif
    1.23  	NULL
    1.24  };
    1.25  SDL_AudioDevice *current_audio = NULL;
    1.26 @@ -181,6 +190,16 @@
    1.27  	D(bug("Entering audio loop...\n"));
    1.28  #endif
    1.29  
    1.30 +#ifdef __OS2__
    1.31 +        // Increase the priority of this thread to make sure that
    1.32 +        // the audio will be continuous all the time!
    1.33 +#ifdef USE_DOSSETPRIORITY
    1.34 +#ifdef DEBUG_BUILD
    1.35 +        printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID());
    1.36 +#endif
    1.37 +        DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0);
    1.38 +#endif
    1.39 +#endif
    1.40  
    1.41  	/* Loop, filling the audio buffers */
    1.42  	while ( audio->enabled ) {
    1.43 @@ -249,6 +268,11 @@
    1.44  	D(bug("CloseAudio..Done, subtask exiting...\n"));
    1.45  	audio_configured = 0;
    1.46  #endif
    1.47 +#ifdef __OS2__
    1.48 +#ifdef DEBUG_BUILD
    1.49 +        printf("[SDL_RunAudio] : Task exiting. (TID%d)\n", SDL_ThreadID());
    1.50 +#endif
    1.51 +#endif
    1.52  	return(0);
    1.53  }
    1.54