From 74383def8f46805faf3391c98516b248108a9a6b Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Wed, 20 Apr 2016 13:22:41 +0300 Subject: movenc: Handle pts == NOPTS when autoflushing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This muxer generally handles pts == NOPTS by using dts instead; do this for consistency here as well. Signed-off-by: Martin Storsjö --- libavformat/movenc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 78ff4ee8ac..b792a3b58e 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3635,7 +3635,10 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt) // duration, but only helps for this particular track, not // for the other ones that are flushed at the same time. trk->track_duration = pkt->dts - trk->start_dts; - trk->end_pts = pkt->pts; + if (pkt->pts != AV_NOPTS_VALUE) + trk->end_pts = pkt->pts; + else + trk->end_pts = pkt->dts; mov_auto_flush_fragment(s, 0); } } -- cgit v1.2.3