changeset 3236:57baf1166899 libavformat

Correct ASF duration. Patch by Henrik Gulbrandsen: henrik gulbra net
author benoit
date Mon, 21 Apr 2008 08:19:16 +0000
parents 2a4192999b55
children 4fa7ec10b57e
files asf-enc.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/asf-enc.c	Sun Apr 20 20:28:12 2008 +0000
+++ b/asf-enc.c	Mon Apr 21 08:19:16 2008 +0000
@@ -733,11 +733,10 @@
     if(codec->codec_type == CODEC_TYPE_AUDIO)
         flags &= ~PKT_FLAG_KEY;
 
-    //XXX /FIXME use duration from AVPacket (quick hack by)
     pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
     assert(pts != AV_NOPTS_VALUE);
     duration = pts * 10000;
-    asf->duration= FFMAX(asf->duration, duration);
+    asf->duration= FFMAX(asf->duration, duration + pkt->duration * 10000);
 
     packet_st = asf->nb_packets;
     put_frame(s, stream, s->streams[pkt->stream_index], pkt->dts, pkt->data, pkt->size, flags);