Reduce audio log when switching between looping and streaming source

develop
kaetemi 4 years ago
parent 56d747fa02
commit 1aba4c13cb
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -359,7 +359,8 @@ void CSourceXAudio2::setStreaming(bool streaming)
_SourceVoice->GetState(&voice_state); _SourceVoice->GetState(&voice_state);
if (!voice_state.BuffersQueued) if (!voice_state.BuffersQueued)
{ {
nlwarning(NLSOUND_XAUDIO2_PREFIX "Switched streaming mode while buffer still queued!?! Flush"); if (!_IsLooping)
nlwarning(NLSOUND_XAUDIO2_PREFIX "Switched streaming mode while buffer still queued!?! Flush");
_SoundDriver->getXAudio2()->CommitChanges(_OperationSet); _SoundDriver->getXAudio2()->CommitChanges(_OperationSet);
if (FAILED(_SourceVoice->FlushSourceBuffers())) if (FAILED(_SourceVoice->FlushSourceBuffers()))
nlwarning(NLSOUND_XAUDIO2_PREFIX "FAILED FlushSourceBuffers"); nlwarning(NLSOUND_XAUDIO2_PREFIX "FAILED FlushSourceBuffers");
@ -555,7 +556,7 @@ bool CSourceXAudio2::preparePlay(IBuffer::TBufferFormat bufferFormat, uint8 chan
} }
if (_SourceVoice && (bufferFormat != _Format || channels != _Channels || bitsPerSample != _BitsPerSample)) if (_SourceVoice && (bufferFormat != _Format || channels != _Channels || bitsPerSample != _BitsPerSample))
{ {
nlwarning(NLSOUND_XAUDIO2_PREFIX "Switching format %u to %u!", (uint32)_Format, (uint32)bufferFormat); // nlwarning(NLSOUND_XAUDIO2_PREFIX "Switching format %u to %u!", (uint32)_Format, (uint32)bufferFormat);
// destroy existing voice // destroy existing voice
_SoundDriver->getXAudio2()->CommitChanges(_OperationSet); _SoundDriver->getXAudio2()->CommitChanges(_OperationSet);
_SoundDriver->destroySourceVoice(_SourceVoice); _SourceVoice = NULL; _SoundDriver->destroySourceVoice(_SourceVoice); _SourceVoice = NULL;

Loading…
Cancel
Save