Fixed FLAC SoundStreams not checking for the EOF decoder state and looping forever.

This commit is contained in:
binary1248 2015-03-11 02:05:52 +01:00 committed by Lukas Dürrenberger
parent cc05fc785a
commit cd9b8b9a15

View File

@ -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;