mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Fixed FLAC SoundStreams not checking for the EOF decoder state and looping forever.
This commit is contained in:
parent
cc05fc785a
commit
cd9b8b9a15
@ -298,8 +298,13 @@ Uint64 SoundFileReaderFlac::read(Int16* samples, Uint64 maxCount)
|
||||
while (m_clientData.remaining > 0)
|
||||
{
|
||||
// Everything happens in the "write" callback
|
||||
// This will break on any fatal error (does not include EOF)
|
||||
if (!FLAC__stream_decoder_process_single(m_decoder))
|
||||
break;
|
||||
|
||||
// Break on EOF
|
||||
if (FLAC__stream_decoder_get_state(m_decoder) == FLAC__STREAM_DECODER_END_OF_STREAM)
|
||||
break;
|
||||
}
|
||||
|
||||
return maxCount - m_clientData.remaining;
|
||||
|
Loading…
Reference in New Issue
Block a user