From 1aba4c13cbba02725cf88e7c1a553172f2701ef7 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 24 May 2021 12:50:13 +0800 Subject: [PATCH] Reduce audio log when switching between looping and streaming source --- nel/src/sound/driver/xaudio2/source_xaudio2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nel/src/sound/driver/xaudio2/source_xaudio2.cpp b/nel/src/sound/driver/xaudio2/source_xaudio2.cpp index 13a613d6d..fa4213386 100644 --- a/nel/src/sound/driver/xaudio2/source_xaudio2.cpp +++ b/nel/src/sound/driver/xaudio2/source_xaudio2.cpp @@ -359,7 +359,8 @@ void CSourceXAudio2::setStreaming(bool streaming) _SourceVoice->GetState(&voice_state); 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); if (FAILED(_SourceVoice->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)) { - 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 _SoundDriver->getXAudio2()->CommitChanges(_OperationSet); _SoundDriver->destroySourceVoice(_SourceVoice); _SourceVoice = NULL;