diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2009-11-03 05:08:19 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2009-11-03 05:08:19 +0000 |
commit | 97eb8c8b6f2b9e9a1d124e972e86765a92c2b37e (patch) | |
tree | 6d1291f8590702c216fc20a4d88386869034fd60 /xdelta3/xdelta3.c | |
parent | 7f7ac45b750fe90bc0572c1a53981910d24b878a (diff) |
Implement (and manually test) main_getblk_func() using FIFO instead of
LRU for non-seekable sources (always, was not previously for the decoder,
which caused problems).
Diffstat (limited to 'xdelta3/xdelta3.c')
-rw-r--r-- | xdelta3/xdelta3.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index 435e8d8..01172ea 100644 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -2518,6 +2518,7 @@ xd3_getblk (xd3_stream *stream, xoff_t blkno) | |||
2518 | ret = stream->getblk (stream, source, blkno); | 2518 | ret = stream->getblk (stream, source, blkno); |
2519 | if (ret != 0) | 2519 | if (ret != 0) |
2520 | { | 2520 | { |
2521 | IF_DEBUG1 (DP(RINT "[getblk] app error: %s\n", xd3_strerror (ret))); | ||
2521 | return ret; | 2522 | return ret; |
2522 | } | 2523 | } |
2523 | } | 2524 | } |
@@ -2581,14 +2582,15 @@ xd3_set_source (xd3_stream *stream, | |||
2581 | src->srclen = 0; | 2582 | src->srclen = 0; |
2582 | src->srcbase = 0; | 2583 | src->srcbase = 0; |
2583 | 2584 | ||
2584 | // If src->blksize is a power-of-two, xd3_blksize_div() will use | 2585 | /* Enforce power-of-two blocksize so that source-block number |
2585 | // shift and mask rather than divide. Check that here. | 2586 | * calculations are cheap. */ |
2586 | if (!xd3_check_pow2 (src->blksize, &shiftby) == 0) | 2587 | if (!xd3_check_pow2 (src->blksize, &shiftby) == 0) |
2587 | { | 2588 | { |
2588 | int check; | 2589 | int check; |
2589 | src->blksize = xd3_pow2_roundup(src->blksize); | 2590 | src->blksize = xd3_pow2_roundup(src->blksize); |
2590 | check = xd3_check_pow2 (src->blksize, &shiftby); | 2591 | check = xd3_check_pow2 (src->blksize, &shiftby); |
2591 | XD3_ASSERT (check == 0); | 2592 | XD3_ASSERT (check == 0); |
2593 | IF_DEBUG1 (DP(RINT "raising srcblksz to %u\n", src->blksize)); | ||
2592 | } | 2594 | } |
2593 | 2595 | ||
2594 | src->shiftby = shiftby; | 2596 | src->shiftby = shiftby; |