paulstretch_cpp

PaulStretch
Log | Files | Refs | LICENSE

commit 2848f71446e71a18a734f285c5b8508fa206ab52
parent 24b5e535706cd65b4dd07a195894d7f02d26aa26
Author: Nasca Octavian PAUL <zynaddsubfx@yahoo.com>
Date:   Sat,  5 Mar 2011 12:53:52 +0200

gzip file bugfix

Diffstat:
MXMLwrapper.cpp | 14+++++++-------
Mreadme.txt | 2++
2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/XMLwrapper.cpp b/XMLwrapper.cpp @@ -253,7 +253,8 @@ int XMLwrapper::loadXMLfile(const char *filename){ char *xmldata=doloadfile(filename); if (xmldata==NULL) return(-1);//the file could not be loaded or uncompressed - + + printf("%s\n",xmldata); root=tree=mxmlLoadString(NULL,xmldata,MXML_OPAQUE_CALLBACK); delete []xmldata; @@ -280,14 +281,13 @@ char *XMLwrapper::doloadfile(const char *filename){ gzFile gzfile=gzopen(filename,"rb"); if (gzfile!=NULL){//this is a gzip file // first check it's size + int bufsize=1024; + char* tmpbuf=new char[bufsize]; + filesize=0; while(!gzeof(gzfile)) { - gzseek (gzfile,1024*1024,SEEK_CUR); - if (gztell(gzfile)>10000000) { - gzclose(gzfile); - goto notgzip;//the file is too big - }; + filesize+=gzread(gzfile,tmpbuf,bufsize); }; - filesize=gztell(gzfile); + delete []tmpbuf; //rewind the file and load the data xmldata=new char[filesize+1]; diff --git a/readme.txt b/readme.txt @@ -73,6 +73,8 @@ History: - Shorten algorithm improvements - Added an option to preserve the tonal part or noise part - Ignored the commandline parameters starting with "-" (usefull for macosx) + 20110303(2.2-0) + - gzip bugfix which prevents loading of the .psx files on Windows Enjoy! :) Paul