Mercurial > libavformat.hg
comparison asf-enc.c @ 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 | 6a5e58d2114b |
children | 0899bfe4105c |
comparison
equal
deleted
inserted
replaced
1344:770363b669aa | 1345:0a74030d9dd7 |
---|---|
280 int header_size, n, extra_size, extra_size2, wav_extra_size, file_time; | 280 int header_size, n, extra_size, extra_size2, wav_extra_size, file_time; |
281 int has_title; | 281 int has_title; |
282 AVCodecContext *enc; | 282 AVCodecContext *enc; |
283 int64_t header_offset, cur_pos, hpos; | 283 int64_t header_offset, cur_pos, hpos; |
284 int bit_rate; | 284 int bit_rate; |
285 | 285 int64_t duration; |
286 | |
287 duration = asf->duration + preroll_time * 10000; | |
286 has_title = (s->title[0] || s->author[0] || s->copyright[0] || s->comment[0]); | 288 has_title = (s->title[0] || s->author[0] || s->copyright[0] || s->comment[0]); |
287 | 289 |
288 bit_rate = 0; | 290 bit_rate = 0; |
289 for(n=0;n<s->nb_streams;n++) { | 291 for(n=0;n<s->nb_streams;n++) { |
290 enc = s->streams[n]->codec; | 292 enc = s->streams[n]->codec; |
310 put_guid(pb, &my_guid); | 312 put_guid(pb, &my_guid); |
311 put_le64(pb, file_size); | 313 put_le64(pb, file_size); |
312 file_time = 0; | 314 file_time = 0; |
313 put_le64(pb, unix_to_file_time(file_time)); | 315 put_le64(pb, unix_to_file_time(file_time)); |
314 put_le64(pb, asf->nb_packets); /* number of packets */ | 316 put_le64(pb, asf->nb_packets); /* number of packets */ |
315 put_le64(pb, asf->duration); /* end time stamp (in 100ns units) */ | 317 put_le64(pb, duration); /* end time stamp (in 100ns units) */ |
316 put_le64(pb, asf->duration); /* duration (in 100ns units) */ | 318 put_le64(pb, duration); /* duration (in 100ns units) */ |
317 put_le32(pb, preroll_time); /* start time stamp */ | 319 put_le32(pb, preroll_time); /* start time stamp */ |
318 put_le32(pb, 0); /* ??? */ | 320 put_le32(pb, 0); /* ??? */ |
319 put_le32(pb, asf->is_streamed ? 1 : 0); /* ??? */ | 321 put_le32(pb, asf->is_streamed ? 1 : 0); /* ??? */ |
320 put_le32(pb, asf->packet_size); /* packet size */ | 322 put_le32(pb, asf->packet_size); /* packet size */ |
321 put_le32(pb, asf->packet_size); /* packet size */ | 323 put_le32(pb, asf->packet_size); /* packet size */ |