[FFmpeg-cvslog] movenc: Handle pts == NOPTS when autoflushing

Martin Storsjö git at videolan.org
Thu May 12 15:28:35 CEST 2016


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Apr 20 13:22:41 2016 +0300| [74383def8f46805faf3391c98516b248108a9a6b] | committer: Martin Storsjö

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 at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=74383def8f46805faf3391c98516b248108a9a6b
---

 libavformat/movenc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 78ff4ee..b792a3b 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);
             }
         }



More information about the ffmpeg-cvslog mailing list