From 69bc6a6d4e235ceccfe425b8252f80bfa2381800 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Jun 2011 18:44:48 +0200 Subject: [PATCH] Changed: Exceptions catched by reference --- .../nel/src/sound/driver/openal/source_al.cpp | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/code/nel/src/sound/driver/openal/source_al.cpp b/code/nel/src/sound/driver/openal/source_al.cpp index 050081df1..fe2dcb086 100644 --- a/code/nel/src/sound/driver/openal/source_al.cpp +++ b/code/nel/src/sound/driver/openal/source_al.cpp @@ -890,22 +890,25 @@ void CSourceAL::setStreamingBuffersMax(uint buffers) unqueueBuffers(); removeBuffers(); - for(uint i = 0; i < _BuffersMax; ++i) - { - try { - // create a new buffer - CBufferAL *buffer = static_cast(_SoundDriver->createBuffer()); - // use StorageSoftware because buffers will be reused - // deleting and recreating them is a waste of time - buffer->setStorageMode(IBuffer::StorageSoftware); - _Buffers[buffer->bufferName()] = buffer; - } catch(ESoundDriverGenBuf &e) { - nlwarning("Cannot create %d buffers. openal fails after %d buffers", buffers, i); - _BuffersMax = i; - _BuffersName.resize(i); - break; - } - } + for(uint i = 0; i < _BuffersMax; ++i) + { + try + { + // create a new buffer + CBufferAL *buffer = static_cast(_SoundDriver->createBuffer()); + // use StorageSoftware because buffers will be reused + // deleting and recreating them is a waste of time + buffer->setStorageMode(IBuffer::StorageSoftware); + _Buffers[buffer->bufferName()] = buffer; + } + catch(const ESoundDriverGenBuf &e) + { + nlwarning("Cannot create %d buffers. openal fails after %d buffers", buffers, i); + _BuffersMax = i; + _BuffersName.resize(i); + break; + } + } } /// Set the default size for streaming buffers