diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index 83218893..e8faf468 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -274,17 +274,21 @@ void SoundStream::streamData() m_isStreaming = false; return; } + } - // Create the buffers - alCheck(alGenBuffers(BufferCount, m_buffers)); - for (int i = 0; i < BufferCount; ++i) - m_endBuffers[i] = false; + // Create the buffers + alCheck(alGenBuffers(BufferCount, m_buffers)); + for (int i = 0; i < BufferCount; ++i) + m_endBuffers[i] = false; - // Fill the queue - requestStop = fillQueue(); + // Fill the queue + requestStop = fillQueue(); - // Play the sound - alCheck(alSourcePlay(m_source)); + // Play the sound + alCheck(alSourcePlay(m_source)); + + { + Lock lock(m_threadMutex); // Check if the thread was launched Paused if (m_threadStartState == Paused)