]> git.sesse.net Git - ffmpeg/commitdiff
Fix wrong ASF duration of generated files
authorBrian Brice <bbrice@gmail.com>
Sun, 1 Oct 2006 17:05:25 +0000 (17:05 +0000)
committerGuillaume Poirier <gpoirier@mplayerhq.hu>
Sun, 1 Oct 2006 17:05:25 +0000 (17:05 +0000)
Patch by Brian Brice % bbrice AH newtek.com %
Original thread:
Message-ID: <451DA316.6060001@newtek.com>
Date: Fri, 29 Sep 2006 17:49:58 -0500
Subject: [Ffmpeg-devel] [PATCH] ASF Duration

Originally committed as revision 6407 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/asf-enc.c
tests/libav.regression.ref

index f885bb743394d5b480ecf8d75d81907bfced937e..32c05b07c62cbe37d366517557b8ae3bbcdc50bb 100644 (file)
@@ -282,7 +282,9 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
     AVCodecContext *enc;
     int64_t header_offset, cur_pos, hpos;
     int bit_rate;
+    int64_t duration;
 
+    duration = asf->duration + preroll_time * 10000;
     has_title = (s->title[0] || s->author[0] || s->copyright[0] || s->comment[0]);
 
     bit_rate = 0;
@@ -312,8 +314,8 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
     file_time = 0;
     put_le64(pb, unix_to_file_time(file_time));
     put_le64(pb, asf->nb_packets); /* number of packets */
-    put_le64(pb, asf->duration); /* end time stamp (in 100ns units) */
-    put_le64(pb, asf->duration); /* duration (in 100ns units) */
+    put_le64(pb, duration); /* end time stamp (in 100ns units) */
+    put_le64(pb, duration); /* duration (in 100ns units) */
     put_le32(pb, preroll_time); /* start time stamp */
     put_le32(pb, 0); /* ??? */
     put_le32(pb, asf->is_streamed ? 1 : 0); /* ??? */
index f337e05ee11b11255c0a9990e6ec9f4e471ad67e..1fe10376de9df55e557412490d1936834604dbbc 100644 (file)
@@ -2,7 +2,7 @@ ffmpeg regression test
 5fb135845dbde3ce5208c468173ef2c2 *./data/b-libav.avi
 343318 ./data/b-libav.avi
 ./data/b-libav.avi CRC=0x1fdd352c
-6f4dca897d9a009009798e434fe5f651 *./data/b-libav.asf
+bac6c5f50f3ca5db6e2ef6eaccf1d4f1 *./data/b-libav.asf
 342967 ./data/b-libav.asf
 ./data/b-libav.asf CRC=0x94d219de
 5275686385346789108ec4fdf06ecef8 *./data/b-libav.rm