Mercurial > sdl-ios-xcode
diff src/audio/android/SDL_androidaudio.c @ 4996:8d7315668e35
Fixed audio buffer lifecycle and implemented audio shutdown
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 13 Jan 2011 12:32:55 -0800 |
parents | 9f9bea41e88f |
children | 327f181542f1 |
line wrap: on
line diff
--- a/src/audio/android/SDL_androidaudio.c Thu Jan 13 11:14:20 2011 -0800 +++ b/src/audio/android/SDL_androidaudio.c Thu Jan 13 12:32:55 2011 -0800 @@ -103,26 +103,19 @@ static void AndroidAUD_PlayDevice(_THIS) { - Android_JNI_WriteAudioBufferAndUnpin(); - this->hidden->mixbuf = NULL; + Android_JNI_WriteAudioBuffer(); } static Uint8 * AndroidAUD_GetDeviceBuf(_THIS) { - if (this->hidden->mixbuf == NULL) { - this->hidden->mixbuf = Android_JNI_PinAudioBuffer(); - } - return this->hidden->mixbuf; + return Android_JNI_GetAudioBuffer(); } static void AndroidAUD_CloseDevice(_THIS) { if (this->hidden != NULL) { - if (this->hidden->mixbuf != NULL) { - Android_JNI_WriteAudioBufferAndUnpin(); - } SDL_free(this->hidden); this->hidden = NULL; }