[Scummvm-cvs-logs] SF.net SVN: scummvm: [30253] scummvm/branches/branch-0-11-0/sound/flac.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Jan 5 21:38:27 CET 2008


Revision: 30253
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30253&view=rev
Author:   fingolfin
Date:     2008-01-05 12:38:26 -0800 (Sat, 05 Jan 2008)

Log Message:
-----------
Backport of fix for bug #1795755: LOOM/FLAC: Pauses (temporary lockups) after speech

Modified Paths:
--------------
    scummvm/branches/branch-0-11-0/sound/flac.cpp

Modified: scummvm/branches/branch-0-11-0/sound/flac.cpp
===================================================================
--- scummvm/branches/branch-0-11-0/sound/flac.cpp	2008-01-05 20:38:16 UTC (rev 30252)
+++ scummvm/branches/branch-0-11-0/sound/flac.cpp	2008-01-05 20:38:26 UTC (rev 30253)
@@ -137,7 +137,7 @@
 	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 @@
 		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();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list