diff options
author | Wolfgang Schupp <w.schupp@a1.net> | 2016-11-24 15:16:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-24 15:16:21 +0100 |
commit | fd7fcfaf0d6c0a1d62d24ab844c0b71f8781a28a (patch) | |
tree | 8fa9d5677c0bdd9034bdfc9fe7afaa24e1b7540e /lib | |
parent | ee22e6eaba92d051699d43f9b4a25af117351e87 (diff) | |
parent | b0e3be09a7418dff76bd96661fa8beda96a4140b (diff) |
Merge pull request #9925 from oskvadd/fastseek
Speed up startup time for movies in split rar archives.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/UnrarXLib/volume.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/UnrarXLib/volume.cpp b/lib/UnrarXLib/volume.cpp index b24e98bd61..1c1d95008a 100644 --- a/lib/UnrarXLib/volume.cpp +++ b/lib/UnrarXLib/volume.cpp @@ -20,8 +20,23 @@ bool MergeArchive(Archive &Arc,ComprDataIO *DataIO,bool ShowFileName,char Comman Arc.Close(); char NextName[NM]; - strcpy(NextName,Arc.FileName); - NextVolumeName(NextName,(Arc.NewMhd.Flags & MHD_NEWNUMBERING)==0 || Arc.OldFormat); + if(DataIO != NULL && (DataIO->m_iSeekTo > Arc.NewLhd.FullPackSize)){ + if (Arc.Volume && Arc.NotFirstVolume) + VolNameToFirstName(Arc.FileName,NextName,(Arc.NewMhd.Flags & MHD_NEWNUMBERING)); + else + strcpy(NextName,Arc.FileName); + + Int64 FastSeek = 0; + while(FastSeek+Arc.NewLhd.FullPackSize < DataIO->m_iSeekTo){ + NextVolumeName(NextName,(Arc.NewMhd.Flags & MHD_NEWNUMBERING)==0 || Arc.OldFormat); + FastSeek += Arc.NewLhd.FullPackSize; + } + DataIO->CurUnpRead = FastSeek; + + }else{ + strcpy(NextName,Arc.FileName); + NextVolumeName(NextName,(Arc.NewMhd.Flags & MHD_NEWNUMBERING)==0 || Arc.OldFormat); + } #if !defined(SFX_MODULE) && !defined(RARDLL) bool RecoveryDone=false; |