diff options
author | Martin Storsjö <martin@martin.st> | 2016-04-20 13:22:41 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2016-04-21 11:20:39 +0300 |
commit | 74383def8f46805faf3391c98516b248108a9a6b (patch) | |
tree | abf6b7aa90d42f312c76a229191287b503962987 | |
parent | 0abb07bad7026a945a31ba4047e6583c8b3fa3da (diff) | |
download | ffmpeg-74383def8f46805faf3391c98516b248108a9a6b.tar.gz |
movenc: Handle pts == NOPTS when autoflushing
This muxer generally handles pts == NOPTS by using dts instead;
do this for consistency here as well.
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/movenc.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); } } |