# HG changeset patch # User gpoirier # Date 1159722325 0 # Node ID 0a74030d9dd7fa29a649b25c116f31c5fd5206b8 # Parent 770363b669aa88c768a03176aabff2e8f5b59a6e 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 diff -r 770363b669aa -r 0a74030d9dd7 asf-enc.c --- 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); /* ??? */