Ticket #3404: flac-loop-fix.patch
File flac-loop-fix.patch, 1.1 KB (added by , 16 years ago) |
---|
-
sound/flac.cpp
137 137 int getRate() const { return _streaminfo.sample_rate; } 138 138 bool endOfData() const { 139 139 // End of data is reached if there either is no valid stream data available, 140 // or if we reached the last sample and completely emptied the sample cache 140 // or if we reached the last sample and completely emptied the sample cache. 141 141 return _streaminfo.channels == 0 || (_lastSampleWritten && _sampleCache.bufFill == 0); 142 142 } 143 143 … … 335 335 FLAC__StreamDecoderState state = getStreamDecoderState(); 336 336 337 337 // Keep poking FLAC to process more samples until we completely satisfied the request 338 while (_requestedSamples > 0 && state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) { 338 // respectively until we run out of data. 339 while (!_lastSampleWritten && _requestedSamples > 0 && state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) { 339 340 assert(_sampleCache.bufFill == 0); 340 341 assert(_requestedSamples % numChannels == 0); 341 342 processSingleBlock();