X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=sidebyside;f=lib%2Frfxswf.c;h=8fe46bd16e5a8180d340c99eaa0e31e83737d1ce;hb=8aa4a7044f8c0ae1eb678b5893ec36127e5d7c22;hp=2912350f1551abc7c2d7cb340b4ac7e706b4bf65;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/lib/rfxswf.c b/lib/rfxswf.c index 2912350..8fe46bd 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -14,8 +14,12 @@ #include "rfxswf.h" +#ifdef HAVE_LIBJPEG +#ifdef HAVE_JPEGLIB_H #include #define _JPEGLIB_INCLUDED_ +#endif //HAVE_JPEGLIB_H +#endif //HAVE_LIBJPEG // Win32 support may be broken since it was only tested in an older version for Watcom C #ifdef __NT__ @@ -42,8 +46,8 @@ LPTAG PrevTag(LPTAG t) { return t->prev; } int GetFrameNo(LPTAG t) { return t->frame; } U16 GetTagID(LPTAG t) { return t->id; } U32 GetDataSize(LPTAG t) { return t->len; } +U8* GetDataSizePtr(LPTAG t) { return &(t->data[t->len]); } U32 GetTagPos(LPTAG t) { return t->pos; } -U8* GetTagPosPtr(LPTAG t) { return &t->data[t->pos]; } // Basic Data Access Functions @@ -487,6 +491,7 @@ LPTAG InsertTag(LPTAG after,U16 id) // updates frames, if nescessary if (t) { memset(t,0x00,sizeof(TAG)); t->id = id; + t->bitcount = 0x80; if (after) { t->frame = after->frame; @@ -759,10 +764,10 @@ int WriteCGI(LPSWF swf) if (len<0) return -1; - sprintf(s,"Content-type: application/x-shockwave-flash\n"\ - "Accept-Ranges: bytes\n"\ - "Content-Length: %lu\n"\ - "Expires: Thu, 13 Apr 2000 23:59:59 GMT\n"\ + sprintf(s,"Content-type: application/x-shockwave-flash\n" + "Accept-Ranges: bytes\n" + "Content-Length: %lu\n" + "Expires: Thu, 13 Apr 2000 23:59:59 GMT\n" "\n",len); write(fileno(stdout),s,strlen(s)); @@ -789,9 +794,9 @@ void FreeTags(LPSWF swf) // Frees all malloc'ed memory for tags #include "modules\swftext.c" #include "modules\swfobject.c" #include "modules\swfbutton.c" -#include "modules\swfbits.c" #include "modules\swftools.c" #include "modules\swfcgi.c" +#include "modules\swfbits.c" #else @@ -800,9 +805,9 @@ void FreeTags(LPSWF swf) // Frees all malloc'ed memory for tags #include "modules/swftext.c" #include "modules/swfobject.c" #include "modules/swfbutton.c" -#include "modules/swfbits.c" #include "modules/swftools.c" #include "modules/swfcgi.c" +#include "modules/swfbits.c" #endif