X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjpeg2swf.c;h=f20b53f8f1e5fe8d6c3a75f46bab167ce844ef3d;hb=4869bc5b2b604ddc9ac43f954f1448f6c868e571;hp=aa01fbc69086ecd99f74fac5c42a2cd1d2945a65;hpb=6f3e9add89a0157ef6552bc154475b43b371e615;p=swftools.git diff --git a/src/jpeg2swf.c b/src/jpeg2swf.c index aa01fbc..f20b53f 100644 --- a/src/jpeg2swf.c +++ b/src/jpeg2swf.c @@ -42,6 +42,7 @@ struct { int verbose; char *outfile; int mx; + int version; } global; typedef struct _image { @@ -61,7 +62,7 @@ TAG *MovieStart(SWF * swf, float framerate, int dx, int dy) memset(swf, 0x00, sizeof(SWF)); - swf->fileVersion = 4; + swf->fileVersion = global.version; swf->frameRate = (int)(256.0 * framerate); swf->movieSize.xmax = dx * 20; swf->movieSize.ymax = dy * 20; @@ -92,8 +93,14 @@ int MovieFinish(SWF * swf, TAG * t, char *sname) sname = "output.swf"; handle = open(sname, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666); } - if (swf_WriteSWF(handle, swf)<0) - fprintf(stderr, "Unable to write output file: %s\n", sname); + if(global.version >= 6) { + if (swf_WriteSWC(handle, swf)<0) + fprintf(stderr, "Unable to write output file: %s\n", sname); + } else { + if (swf_WriteSWF(handle, swf)<0) + fprintf(stderr, "Unable to write output file: %s\n", sname); + } + if (handle != so) close(handle); @@ -368,6 +375,7 @@ int args_callback_option(char *arg, char *val) case 'm': global.mx = 1; + global.version = 6; return 0; case 'Y': @@ -459,6 +467,7 @@ int main(int argc, char **argv) global.quality = 60; global.framerate = 1.0; global.verbose = 1; + global.version = 4; processargs(argc, argv);