summaryrefslogtreecommitdiff
path: root/packages/paszlib
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-02-07 21:31:17 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-02-07 21:31:17 +0000
commit4308f63d6338899ed24367e1fd346a9cfc0ac735 (patch)
treec4bfd6997f5322f3a1f293726c930480ab263fa8 /packages/paszlib
parent6b58516786bd6ee80e93048cd0002d5297d5a2eb (diff)
downloadfpc-4308f63d6338899ed24367e1fd346a9cfc0ac735.tar.gz
* another patch for seeking in compressed streams by Danny Milosavljevic, resolves #12830
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@12705 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/paszlib')
-rw-r--r--packages/paszlib/src/zstream.pp8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/paszlib/src/zstream.pp b/packages/paszlib/src/zstream.pp
index 3c2db6a81d..4213188b8a 100644
--- a/packages/paszlib/src/zstream.pp
+++ b/packages/paszlib/src/zstream.pp
@@ -70,6 +70,7 @@ type
raw_read,compressed_read:longint;
skipheader:boolean;
procedure reset;
+ function GetPosition() : Int64; override;
public
constructor create(Asource:Tstream;Askipheader:boolean=false);
destructor destroy;override;
@@ -321,6 +322,11 @@ begin
raise Edecompressionerror.create(zerror(err));
end;
+function Tdecompressionstream.GetPosition() : Int64;
+begin
+ GetPosition := raw_read;
+end;
+
function Tdecompressionstream.seek(offset:longint;origin:word):longint;
var c:longint;
@@ -330,7 +336,7 @@ begin
((origin=sofromcurrent) and (offset+raw_read>=0)) then
begin
if origin = sofromcurrent then
- seek := compressed_read - offset
+ seek := raw_read + offset
else
seek := offset;