+void writeheader(struct writer_t*w, u8*data, int length)
+{
+ if(config.hassizex || config.hassizey || config.framerate)
+ {
+ struct flash_header head;
+ swf_init(data-3, length+3);
+ head = swf_read_header();
+ if(config.hassizex)
+ {
+ head.boundingBox.x2 = head.boundingBox.x1 + config.sizex;
+ }
+ if(config.hassizey)
+ {
+ head.boundingBox.y2 = head.boundingBox.y1 + config.sizey;
+ }
+ if(config.framerate)
+ {
+ head.rate = config.framerate;
+ }
+ swf_write_header(w, &head);
+ }
+ else
+ writer_write(w, data, length);
+}