mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Fixed OpenAL error when stopping sound streams
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1036 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
66681bc1ae
commit
e28a89f902
@ -31,11 +31,11 @@ void PlaySound()
|
|||||||
// Loop while the sound is playing
|
// Loop while the sound is playing
|
||||||
while (Sound.GetStatus() == sf::Sound::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
|
// Leave some CPU time for other processes
|
||||||
sf::Sleep(0.1f);
|
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;
|
std::cout << std::endl << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -272,6 +272,7 @@ void SoundStream::Run()
|
|||||||
ClearQueue();
|
ClearQueue();
|
||||||
|
|
||||||
// Delete the buffers
|
// Delete the buffers
|
||||||
|
ALCheck(alSourcei(Sound::mySource, AL_BUFFER, 0));
|
||||||
ALCheck(alDeleteBuffers(BuffersCount, myBuffers));
|
ALCheck(alDeleteBuffers(BuffersCount, myBuffers));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user