aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2008-01-05 20:38:16 +0000
committerMax Horn2008-01-05 20:38:16 +0000
commit89da803724467f94aa0973d867ed25b5e3bdf228 (patch)
tree6c4cb394861ed140ce5ecf5f5cc0e0896a60dc27 /sound
parentd604f51d4245bc770bd12609be0984f15bc77dd1 (diff)
downloadscummvm-rg350-89da803724467f94aa0973d867ed25b5e3bdf228.tar.gz
scummvm-rg350-89da803724467f94aa0973d867ed25b5e3bdf228.tar.bz2
scummvm-rg350-89da803724467f94aa0973d867ed25b5e3bdf228.zip
Fix for bug #1795755: LOOM/FLAC: Pauses (temporary lockups) after speech
svn-id: r30252
Diffstat (limited to 'sound')
-rw-r--r--sound/flac.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/flac.cpp b/sound/flac.cpp
index d706436941..103d222589 100644
--- a/sound/flac.cpp
+++ b/sound/flac.cpp
@@ -137,7 +137,7 @@ public:
int getRate() const { return _streaminfo.sample_rate; }
bool endOfData() const {
// End of data is reached if there either is no valid stream data available,
- // or if we reached the last sample and completely emptied the sample cache
+ // or if we reached the last sample and completely emptied the sample cache.
return _streaminfo.channels == 0 || (_lastSampleWritten && _sampleCache.bufFill == 0);
}
@@ -335,7 +335,8 @@ int FlacInputStream::readBuffer(int16 *buffer, const int numSamples) {
FLAC__StreamDecoderState state = getStreamDecoderState();
// Keep poking FLAC to process more samples until we completely satisfied the request
- while (_requestedSamples > 0 && state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) {
+ // respectively until we run out of data.
+ while (!_lastSampleWritten && _requestedSamples > 0 && state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) {
assert(_sampleCache.bufFill == 0);
assert(_requestedSamples % numChannels == 0);
processSingleBlock();