Mercurial > libavformat.hg
comparison asf-enc.c @ 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 | 4591452ec78c |
children | 7a0230981402 |
comparison
equal
deleted
inserted
replaced
3235:2a4192999b55 | 3236:57baf1166899 |
---|---|
731 stream = &asf->streams[pkt->stream_index]; | 731 stream = &asf->streams[pkt->stream_index]; |
732 | 732 |
733 if(codec->codec_type == CODEC_TYPE_AUDIO) | 733 if(codec->codec_type == CODEC_TYPE_AUDIO) |
734 flags &= ~PKT_FLAG_KEY; | 734 flags &= ~PKT_FLAG_KEY; |
735 | 735 |
736 //XXX /FIXME use duration from AVPacket (quick hack by) | |
737 pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; | 736 pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; |
738 assert(pts != AV_NOPTS_VALUE); | 737 assert(pts != AV_NOPTS_VALUE); |
739 duration = pts * 10000; | 738 duration = pts * 10000; |
740 asf->duration= FFMAX(asf->duration, duration); | 739 asf->duration= FFMAX(asf->duration, duration + pkt->duration * 10000); |
741 | 740 |
742 packet_st = asf->nb_packets; | 741 packet_st = asf->nb_packets; |
743 put_frame(s, stream, s->streams[pkt->stream_index], pkt->dts, pkt->data, pkt->size, flags); | 742 put_frame(s, stream, s->streams[pkt->stream_index], pkt->dts, pkt->data, pkt->size, flags); |
744 | 743 |
745 /* check index */ | 744 /* check index */ |