From: Brad A. <br...@us...> - 2013-02-06 02:27:10
|
gemrb: Infinity Engine emulator The branch master has been updated via 54b260bdea2d74700031d547e95fca6bf4e28d40 (commit) via dda45e9f24cb950d1661804e1365060d2165291d (commit) Summary of changes: gemrb/plugins/OpenALAudio/OpenALAudio.cpp | 28 ++++++++++++++++++++++------ 1 files changed, 22 insertions(+), 6 deletions(-) from f2886b6f9f02558d28e844241a20bcf003e9ab0d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=54b260bdea2d74700031d547e95fca6bf4e28d40 commit 54b260bdea2d74700031d547e95fca6bf4e28d40 Author: Brad Allred <bra...@me...> Date: Tue Feb 5 19:26:48 2013 -0700 OpenAL: add more error checking diff --git a/gemrb/plugins/OpenALAudio/OpenALAudio.cpp b/gemrb/plugins/OpenALAudio/OpenALAudio.cpp index f1cddba..0fce618 100644 --- a/gemrb/plugins/OpenALAudio/OpenALAudio.cpp +++ b/gemrb/plugins/OpenALAudio/OpenALAudio.cpp @@ -53,6 +53,7 @@ void OpenALSoundHandle::SetPos(int XPos, int YPos) { }; alSourcefv(parent->Source, AL_POSITION, SourcePos); + checkALError("Unable to set source position", WARNING); } bool OpenALSoundHandle::Playing() { @@ -72,13 +73,13 @@ void OpenALSoundHandle::StopLooping() { if (!parent) return; alSourcei(parent->Source, AL_LOOPING, 0); + checkALError("Unable to stop audio loop", WARNING); } void AudioStream::ClearProcessedBuffers() { ALint processed = 0; alGetSourcei( Source, AL_BUFFERS_PROCESSED, &processed ); - checkALError("Failed to get processed buffers", WARNING); if (processed > 0) { @@ -111,7 +112,10 @@ void AudioStream::ClearIfStopped() { if (free || locked) return; - if (!Source || !alIsSource(Source)) return; + if (!Source || !alIsSource(Source)) { + checkALError("No AL Context", WARNING); + return; + } ALint state; alGetSourcei( Source, AL_SOURCE_STATE, &state ); @@ -305,6 +309,7 @@ ALuint OpenALAudioDriver::loadSound(const char *ResRef, unsigned int &time_lengt ResourceHolder<SoundMgr> acm(ResRef); if (!acm) { alDeleteBuffers( 1, &Buffer ); + checkALError("Unable to delete buffer!", ERROR); return 0; } int cnt = acm->get_length(); @@ -599,6 +604,7 @@ int OpenALAudioDriver::CreateStream(Holder<SoundMgr> newMusic) void OpenALAudioDriver::UpdateListenerPos(int XPos, int YPos ) { alListener3f( AL_POSITION, (float) XPos, (float) YPos, 0.0f ); + checkALError("Unable to update listener position.", WARNING); } void OpenALAudioDriver::GetListenerPos(int &XPos, int &YPos ) http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=dda45e9f24cb950d1661804e1365060d2165291d commit dda45e9f24cb950d1661804e1365060d2165291d Author: Brad Allred <bra...@me...> Date: Tue Feb 5 19:26:09 2013 -0700 OpenAL: better handle when queuing or playing a source fails return from the function for these errors diff --git a/gemrb/plugins/OpenALAudio/OpenALAudio.cpp b/gemrb/plugins/OpenALAudio/OpenALAudio.cpp index 3d97662..f1cddba 100644 --- a/gemrb/plugins/OpenALAudio/OpenALAudio.cpp +++ b/gemrb/plugins/OpenALAudio/OpenALAudio.cpp @@ -807,12 +807,22 @@ int OpenALAudioDriver::MusicManager(void* arg) driver->music_memory, ACM_BUFFERSIZE, driver->MusicReader->get_samplerate() ); } + checkALError("Unable to buffer data.", ERROR); + // FIXME: determine if we should error out if any data fails to buffer alSourceQueueBuffers( driver->MusicSource, MUSICBUFFERS, driver->MusicBuffer ); - if (driver->MusicSource && alIsSource( driver->MusicSource )) { - alSourcePlay( driver->MusicSource ); - checkALError("Error playing music source", ERROR); + if (!checkALError("Unable to queue buffer.", ERROR)) { + if (driver->MusicSource && alIsSource( driver->MusicSource )) { + alSourcePlay( driver->MusicSource ); + if (!checkALError("Error playing music source", ERROR)) { + // no errors happened + bFinished = AL_FALSE; + break; + } + } } - bFinished = AL_FALSE; + // if all had gone well we would have broken out + driver->MusicPlaying = false; + return -1; } break; case AL_STOPPED: ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |