diff options
author | Brian Brice <bbrice@gmail.com> | 2006-10-01 17:05:25 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2006-10-01 17:05:25 +0000 |
commit | 4336886c520c82d2f1a8e62a158a6a69874d4a5a (patch) | |
tree | 247c1d1060d265e8684cd457652727771bcf900d /libavformat | |
parent | eaa6d7b6838f630ec493b656ca9e805a2d6eb422 (diff) | |
download | ffmpeg-4336886c520c82d2f1a8e62a158a6a69874d4a5a.tar.gz |
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
Originally committed as revision 6407 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/asf-enc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/asf-enc.c b/libavformat/asf-enc.c index f885bb7433..32c05b07c6 100644 --- a/libavformat/asf-enc.c +++ b/libavformat/asf-enc.c @@ -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); /* ??? */ |