Changeset 499 for trunk/thune/gl/audio.c

Show
Ignore:
Timestamp:
12/05/07 03:12:00 (12 months ago)
Author:
krobillard
Message:

Added ur_threadDestroy(). Removed ur_threadFree() from public API.
c_string.t should now handle all quotes properly.
Minor fix in GL boot
Documented stack.level.
Increased OpenAL music buffer size and now handle alutInit() failure.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/gl/audio.c

    r458 r499  
    5555 
    5656static int _audioUp = 0; 
    57 #if 0 
     57//#define OPEN_DEVICE     1 
     58#ifdef OPEN_DEVICE 
    5859static ALCdevice*  _adevice  = 0; 
    5960static ALCcontext* _acontext = 0; 
     
    6263 
    6364 
    64 #define MUSIC_BUFFERS       2 
     65#define MUSIC_BUFFERS       3 
    6566static ALuint  _musicSource = 0; 
    6667static ALfloat _musicGain = 1.0f; 
     
    7677#define OGG_BIG_ENDIAN  1 
    7778#endif 
    78 #define OGG_BUFFER_SIZE  (4096 * 4) 
     79 
     80/*  
     81   OGG_BUFFER_SIZE is set to hold one second of data in each music buffer. 
     82   If aud_update() is not called before all buffers are played then OpenAL 
     83   will stop the sound source. 
     84*/ 
     85#define OGG_BUFFER_SIZE  (44100 * 2) 
    7986static char _oggPCM[ OGG_BUFFER_SIZE ]; 
    8087 
     
    141148int aud_startup() 
    142149{ 
    143 #if 0 
     150#ifdef OPEN_DEVICE 
    144151    _adevice = alcOpenDevice( 0 ); 
    145152    if( ! _adevice ) 
     
    150157    alutInitWithoutContext( 0, 0 ); 
    151158#else 
    152     alutInit( 0, 0 ); 
     159    if( alutInit( 0, 0 ) == AL_FALSE ) 
     160        return 0; 
    153161#endif 
    154162 
     
    175183        alDeleteBuffers( MUSIC_BUFFERS, _musicBuffers ); 
    176184 
    177 #if 0 
     185#ifdef OPEN_DEVICE 
    178186        // Could not use alutExit() on my box (FC3/Shuttle XPC) since 
    179187        // alcMakeContextCurrent(0) -> _alLockMixerPause() will hangup. 
    180188        alcDestroyContext( _acontext ); 
    181189        alcCloseDevice( _adevice ); 
    182 #endif 
     190#else 
    183191        alutExit(); 
     192#endif 
    184193    } 
    185194}