mirror of
https://github.com/SFML/SFML.git
synced 2025-01-31 21:55:13 +08:00
Allow SoundStream::play to be called again after reaching the end
This commit is contained in:
parent
8e95d1c73a
commit
fae91bbbf2
@ -136,6 +136,12 @@ void SoundStream::play()
|
||||
// If the sound is playing, stop it and continue as if it was stopped
|
||||
stop();
|
||||
}
|
||||
else if (!isStreaming && m_thread.joinable())
|
||||
{
|
||||
// If the streaming thread reached its end, let it join so it can be restarted.
|
||||
// Also reset the playing offset at the beginning.
|
||||
stop();
|
||||
}
|
||||
|
||||
// Start updating the stream in a separate thread to avoid blocking the application
|
||||
launchStreamingThread(Playing);
|
||||
|
Loading…
Reference in New Issue
Block a user