From b2a8ce4e6771244fe7a3a1e4c6bda4ec28775575 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <michaelni@gmx.at> Date: Sun, 19 Aug 2012 23:34:38 +0200 Subject: nutenc: keep track of max_pts Signed-off-by: Michael Niedermayer <michaelni@gmx.at> --- libavformat/nutenc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavformat/nutenc.c') diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 00f4653f09..97bed1ef1d 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -863,6 +863,11 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt){ nus->keyframe_pts[nut->sp_count] = pkt->pts; } + if(!nut->max_pts_tb || av_compare_ts(nut->max_pts, *nut->max_pts_tb, pkt->pts, *nus->time_base) < 0) { + nut->max_pts = pkt->pts; + nut->max_pts_tb = nus->time_base; + } + return 0; } -- cgit v1.2.3