changeset 1345:0a74030d9dd7 libavformat

Fix wrong ASF duration of generated files 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
author gpoirier
date Sun, 01 Oct 2006 17:05:25 +0000
parents 770363b669aa
children 3637b5c4e882
files asf-enc.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/asf-enc.c	Sat Sep 30 11:50:03 2006 +0000
+++ b/asf-enc.c	Sun Oct 01 17:05:25 2006 +0000
@@ -282,7 +282,9 @@
     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 @@
     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); /* ??? */