[FFmpeg-devel] [PATCH] Keep track of stream duration and nb_frames when muxing

Baptiste Coudurier baptiste.coudurier
Tue Jan 19 06:25:08 CET 2010


Hi,

On 1/18/10 9:18 PM, David Conrad wrote:
> Hi,
>
> [...]
>
> @@ -2785,6 +2791,11 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
>       if(compute_pkt_fields2(s, st, pkt)<  0&&  !(s->oformat->flags&  AVFMT_NOTIMESTAMPS))
>           return -1;
>
> +    if (!st->nb_frames)
> +        st->start_time = pkt->pts;
> +    st->duration = pkt->pts + pkt->duration;

st->duration = FFMAX(st->duration, pkt->pts + pkt->duration);

and same above, is more correct.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list