update swf video frame number when muxing done, fix #439
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sat, 19 Jul 2008 03:25:50 +0000 (03:25 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sat, 19 Jul 2008 03:25:50 +0000 (03:25 +0000)
Originally committed as revision 14293 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/swf.h
libavformat/swfenc.c
tests/libav.regression.ref

index dee69160cfcc62edd508cfe4f8c784422c92cc44..8249f7ddf957200aa3a4cf904410b0baa3cd4a3e 100644 (file)
@@ -67,7 +67,7 @@ typedef struct {
     int audio_stream_index;
     offset_t duration_pos;
     offset_t tag_pos;
-
+    offset_t vframes_pos;
     int samples_per_frame;
     int sound_samples;
     int swf_frame_number;
index 193663f61e2a7dac7015ba7b4501090d77a1b765..2d341dcc47e0c46498cd94bb7bcf98d8a2490b27 100644 (file)
@@ -344,6 +344,7 @@ static int swf_write_video(AVFormatContext *s,
             /* create a new video object */
             put_swf_tag(s, TAG_VIDEOSTREAM);
             put_le16(pb, VIDEO_ID);
+            swf->vframes_pos = url_ftell(pb);
             put_le16(pb, 15000); /* hard flash player limit */
             put_le16(pb, enc->width);
             put_le16(pb, enc->height);
@@ -495,6 +496,8 @@ static int swf_write_trailer(AVFormatContext *s)
         put_le32(pb, file_size);
         url_fseek(pb, swf->duration_pos, SEEK_SET);
         put_le16(pb, swf->video_frame_number);
+        url_fseek(pb, swf->vframes_pos, SEEK_SET);
+        put_le16(pb, swf->video_frame_number);
         url_fseek(pb, file_size, SEEK_SET);
     }
     return 0;
index a42ecd1a0e81f89d77c93c0fb32b0a27d5c7c74d..3057e94d004ac3bb8f8dba94bedf22410789e580 100644 (file)
@@ -12,7 +12,7 @@ bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg
 447b005e527cf495ec13092e788f028d *./tests/data/b-libav.ts
 471692 ./tests/data/b-libav.ts
 ./tests/data/b-libav.ts CRC=0xcc4948e1
-d6fdeb9f7083cc827f9510c6c4517dc0 *./tests/data/b-libav.swf
+1b28a16652bb8ac528b33f7478ca18b6 *./tests/data/b-libav.swf
 335771 ./tests/data/b-libav.swf
 ./tests/data/b-libav.swf CRC=0xe14e8847
 3dbacdc3fccb551f8ab54c32f648e7a8 *./tests/data/b-libav.ffm