From e28a89f902c999c3cae276d6d10d175d57827803 Mon Sep 17 00:00:00 2001 From: laurentgom Date: Mon, 2 Mar 2009 17:15:55 +0000 Subject: [PATCH] Fixed OpenAL error when stopping sound streams git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1036 4e206d99-4929-0410-ac5d-dfc041789085 --- samples/sound/Sound.cpp | 6 +++--- src/SFML/Audio/SoundStream.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/sound/Sound.cpp b/samples/sound/Sound.cpp index c50b0c542..982eb99cd 100644 --- a/samples/sound/Sound.cpp +++ b/samples/sound/Sound.cpp @@ -31,11 +31,11 @@ void PlaySound() // Loop while the sound is playing while (Sound.GetStatus() == sf::Sound::Playing) { - // Display the playing position - std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << Sound.GetPlayingOffset() << " sec "; - // Leave some CPU time for other processes sf::Sleep(0.1f); + + // Display the playing position + std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << Sound.GetPlayingOffset() << " sec "; } std::cout << std::endl << std::endl; } diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index 0c796f8d2..0639a99f2 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -272,6 +272,7 @@ void SoundStream::Run() ClearQueue(); // Delete the buffers + ALCheck(alSourcei(Sound::mySource, AL_BUFFER, 0)); ALCheck(alDeleteBuffers(BuffersCount, myBuffers)); }