X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Frfxswf.c;h=34487f18a815ae0af89a38e7e63d8a74656ee42f;hb=973be5a3457e56651310a81cb7cb2980e0d0f663;hp=0563e8170ad0e8337bc764160db962d8cd781b0b;hpb=fb6171381f99ab5cccd467a4fdca1488aadd6916;p=swftools.git diff --git a/lib/rfxswf.c b/lib/rfxswf.c index 0563e81..34487f1 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -640,6 +640,30 @@ TAG * swf_InsertTag(TAG * after,U16 id) // updates frames, if nescessary return t; } +TAG * swf_InsertTagBefore(SWF* swf, TAG * before,U16 id) // updates frames, if nescessary +{ TAG * t; + + t = (TAG *)malloc(sizeof(TAG)); + if (t) + { memset(t,0x00,sizeof(TAG)); + t->id = id; + + if (before) + { t->frame = before->frame; + t->next = before; + t->prev = before->prev; + before->prev = t; + if (t->prev) t->prev->next = t; + + if (id==ST_SHOWFRAME) swf_UpdateFrame(t->next,+1); + } + } + if(swf && swf->firstTag == before) { + swf->firstTag = t; + } + return t; +} + void swf_ClearTag(TAG * t) { if (t->data) free(t->data); @@ -1119,6 +1143,9 @@ int swf_WriteSWF2(struct writer_t*writer, SWF * swf) // Writes SWF to file, swf_SetU16(&t2, swf->frameCount); l = swf_GetTagLen(&t2)+8; } + if(swf->compressed == 8) { + l -= 8; + } fileSize = l+len; if(len) {// don't touch headers without tags @@ -1148,6 +1175,7 @@ int swf_WriteSWF2(struct writer_t*writer, SWF * swf) // Writes SWF to file, writer = &zwriter; } } + swf_SetRect(&t1,&swf->movieSize); swf_SetU16(&t1,swf->frameRate); swf_SetU16(&t1,swf->frameCount); @@ -1254,3 +1282,4 @@ void swf_FreeTags(SWF * swf) // Frees all malloc'ed memory for t #include "modules/swfbits.c" #include "modules/swfaction.c" #include "modules/swfsound.c" +#include "h.263/swfvideo.c"