- simple bugfix for file xfer's

- added openal call to try to work around an openal bug on some platforms
This commit is contained in:
Mark Vejvoda 2011-03-14 20:25:27 +00:00
parent c54174061f
commit 6eab8f905e
2 changed files with 16 additions and 10 deletions

View File

@ -55,9 +55,9 @@ FTPServerThread::FTPServerThread(std::pair<string,string> 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;

View File

@ -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__);