[Flac-dev] better seeking

Miroslav Lichvar lichvarm at phoenix.inf.upol.cz
Fri Nov 3 10:00:45 PST 2006


On Fri, Nov 03, 2006 at 10:01:42AM +0100, Miroslav Lichvar wrote:
> Thanks. Sending latest version of the patch. Now it can seek in files
> that have large id3 tag (or any random data) at the end and it won't loop on
> streams with shuffled frames.

One small patch on top of that and it's bug free. ;)

-- 
Miroslav Lichvar
-------------- next part --------------
--- flac/src/libFLAC/stream_decoder.c.orig	2006-11-03 18:52:38.104291323 +0100
+++ flac/src/libFLAC/stream_decoder.c	2006-11-03 18:53:41.350727144 +0100
@@ -2995,7 +2995,7 @@
 
 	while(1) {
 		/* check if the bounds are still ok */
-		if (lower_bound_sample + FLAC__MIN_BLOCK_SIZE > upper_bound_sample || lower_bound > upper_bound) {
+		if (lower_bound_sample >= upper_bound_sample || lower_bound > upper_bound) {
 			decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
 			return false;
 		}


More information about the Flac-dev mailing list