X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Frfxswf.c;h=2f80c888a4b48f17ac6706ef072fb952db1e218a;hb=607c5dadd6089768b618cc99346de1b37a2c46f1;hp=e6f30c15c1fb188e8cc311a0836631734ba82276;hpb=75e8a98f513e75e2a09dc3e96edc5111af9c1abf;p=swftools.git diff --git a/lib/rfxswf.c b/lib/rfxswf.c index e6f30c1..2f80c88 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -1311,9 +1311,11 @@ int swf_WriteSWF2(struct writer_t*writer, SWF * swf) // Writes SWF to file, #ifdef INSERT_RFX_TAG - if (swf->firstTag && swf_NextTag(swf->firstTag)) - if (swf_GetTagID(swf_NextTag(swf->firstTag))!=ST_REFLEX) + if (swf->firstTag && swf->firstTag->next && + (swf->firstTag->id != ST_REFLEX || swf->firstTag->next->id != ST_REFLEX) + ) { swf_SetBlock(swf_InsertTagBefore(swf, swf->firstTag,ST_REFLEX),"rfx",3); + } #endif // INSERT_RFX_TAG @@ -1488,6 +1490,22 @@ int swf_WriteCGI(SWF * swf) return swf_WriteSWF(fileno(stdout),swf); } +SWF* swf_CopySWF(SWF*swf) +{ + SWF*nswf = rfx_alloc(sizeof(SWF)); + memcpy(nswf, swf, sizeof(SWF)); + nswf->firstTag = 0; + TAG*tag = swf->firstTag; + TAG*ntag = 0; + while(tag) { + ntag = swf_CopyTag(ntag, tag); + if(!nswf->firstTag) + nswf->firstTag = ntag; + tag = tag->next; + } + return nswf; +} + void swf_FreeTags(SWF * swf) // Frees all malloc'ed memory for tags { TAG * t = swf->firstTag;