diff --git a/source/shared_lib/sources/platform/posix/miniftpserver.cpp b/source/shared_lib/sources/platform/posix/miniftpserver.cpp index 9b4965db..5dc6eb65 100644 --- a/source/shared_lib/sources/platform/posix/miniftpserver.cpp +++ b/source/shared_lib/sources/platform/posix/miniftpserver.cpp @@ -55,9 +55,9 @@ FTPServerThread::FTPServerThread(std::pair mapsPath, this->mapsPath = mapsPath; this->tilesetsPath = tilesetsPath; this->techtreesPath = techtreesPath; - setInternetEnabled(internetEnabledFlag,true); this->allowInternetTilesetFileTransfers = allowInternetTilesetFileTransfers; this->allowInternetTechtreeFileTransfers = allowInternetTechtreeFileTransfers; + setInternetEnabled(internetEnabledFlag,true); this->portNumber = portNumber; this->maxPlayers = maxPlayers; this->ftpValidationIntf = ftpValidationIntf; diff --git a/source/shared_lib/sources/sound/openal/sound_player_openal.cpp b/source/shared_lib/sources/sound/openal/sound_player_openal.cpp index 9b20fd62..5a30ad53 100644 --- a/source/shared_lib/sources/sound/openal/sound_player_openal.cpp +++ b/source/shared_lib/sources/sound/openal/sound_player_openal.cpp @@ -48,13 +48,21 @@ bool SoundSource::playing() } void SoundSource::unQueueBuffers() { - int queued; - alGetSourcei(source, AL_BUFFERS_QUEUED, &queued); - while(queued--) { - ALuint buffer; - alSourceUnqueueBuffers(source, 1, &buffer); - } + int processed; + alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed); + SoundPlayerOpenAL::checkAlError("Problem unqueuing buffers (alGetSourcei AL_BUFFERS_PROCESSED) in audio source: "); + int queued; + alGetSourcei(source, AL_BUFFERS_QUEUED, &queued); + SoundPlayerOpenAL::checkAlError("Problem unqueuing buffers (alGetSourcei AL_BUFFERS_QUEUED) in audio source: "); + + //if(processed < queued) { + while(queued--) { + ALuint buffer; + alSourceUnqueueBuffers(source, 1, &buffer); + SoundPlayerOpenAL::checkAlError("Problem unqueuing buffers (alSourceUnqueueBuffers) in audio source: "); + } + //} } void SoundSource::stop() @@ -63,14 +71,12 @@ void SoundSource::stop() alSourceStop(source); - SoundPlayerOpenAL::checkAlError("Problem stopping audio source: "); + SoundPlayerOpenAL::checkAlError("Problem stopping audio source (alSourceStop): "); //SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); unQueueBuffers(); - SoundPlayerOpenAL::checkAlError("Problem unqueuing buffers in audio source: "); - alSourcei(source, AL_BUFFER, AL_NONE); //SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);