added some more generic tag functions.
[swftools.git] / src / jpeg2swf.c
index 16efc3c..098308d 100644 (file)
@@ -211,7 +211,7 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int quality,
        t = swf_InsertTag(t, ST_VIDEOFRAME);
        swf_SetU16(t, 0xf00d);
        quant = 1+(30-(30*quality)/100);
-       if(!(frame&127)) {
+       if(!(frame%20)) {
            swf_SetVideoStreamIFrame(t, &stream, pic2, quant);
        } else {
            swf_SetVideoStreamPFrame(t, &stream, pic2, quant);
@@ -254,8 +254,10 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int quality,
        swf_ShapeSetLine(t, s, 0, -r.ymax);
        swf_ShapeSetEnd(t);
 
-       t = swf_InsertTag(t, ST_REMOVEOBJECT2);
-       swf_SetU16(t, 1);               // depth
+        if(frame) {
+           t = swf_InsertTag(t, ST_REMOVEOBJECT2);
+           swf_SetU16(t, 1);           // depth
+        }
 
        t = swf_InsertTag(t, ST_PLACEOBJECT2);
        swf_GetMatrix(NULL, &m);