projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add audio to proxy, and minor bug fixes
[goodguy/history.git]
/
cinelerra-5.1
/
cinelerra
/
filexml.C
diff --git
a/cinelerra-5.1/cinelerra/filexml.C
b/cinelerra-5.1/cinelerra/filexml.C
index 1da5a5e067359d0a8aae04af44f59ced9bed0a64..065dce7db07758c48a49b9a6366a3dac0e0180e1 100644
(file)
--- a/
cinelerra-5.1/cinelerra/filexml.C
+++ b/
cinelerra-5.1/cinelerra/filexml.C
@@
-58,7
+58,7
@@
XMLBuffer::XMLBuffer(const char *buf, long buf_size, int del)
destroy = del;
}
destroy = del;
}
-XMLBuffer::XMLBuffer(long buf_size, c
onst c
har *buf, int del)
+XMLBuffer::XMLBuffer(long buf_size, char *buf, int del)
{ // writing
bfr = (unsigned char *)buf;
bsz = buf_size;
{ // writing
bfr = (unsigned char *)buf;
bsz = buf_size;
@@
-76,9
+76,10
@@
XMLBuffer::~XMLBuffer()
unsigned char *&XMLBuffer::demand(long len)
{
if( len > bsz ) {
unsigned char *&XMLBuffer::demand(long len)
{
if( len > bsz ) {
- len += BCTEXTLEN;
+ long sz = inp-bfr;
+ len += sz/2 + BCTEXTLEN;
unsigned char *np = new unsigned char[len];
unsigned char *np = new unsigned char[len];
- if(
inp > bfr ) memcpy(np,bfr,inp-bfr
);
+ if(
sz > 0 ) memcpy(np,bfr,sz
);
inp = np + (inp-bfr);
outp = np + (outp-bfr);
lmt = np + len; bsz = len;
inp = np + (inp-bfr);
outp = np + (outp-bfr);
lmt = np + len; bsz = len;
@@
-488,7
+489,7
@@
int FileXML::skip_tag()
return 1;
}
return 1;
}
-int FileXML::read_data_until(const char *tag_end, char *out, int len)
+int FileXML::read_data_until(const char *tag_end, char *out, int len
, int skip
)
{
long ipos = buffer->itell();
int opos = 0, pos = -1;
{
long ipos = buffer->itell();
int opos = 0, pos = -1;
@@
-517,15
+518,15
@@
int FileXML::read_data_until(const char *tag_end, char *out, int len)
++pos;
}
// if end tag is reached, pos is left on the < of the end tag
++pos;
}
// if end tag is reached, pos is left on the < of the end tag
- if( pos >= 0 && !tag_end[pos] )
+ if(
!skip &&
pos >= 0 && !tag_end[pos] )
buffer->iseek(ipos);
return opos;
}
buffer->iseek(ipos);
return opos;
}
-int FileXML::read_text_until(const char *tag_end, char *out, int len)
+int FileXML::read_text_until(const char *tag_end, char *out, int len
, int skip
)
{
char data[len+1];
{
char data[len+1];
- int opos = read_data_until(tag_end, data, len);
+ int opos = read_data_until(tag_end, data, len
, skip
);
decode(out, data, opos);
return 0;
}
decode(out, data, opos);
return 0;
}