[FFmpeg-devel] [PATCH] movenc: calculate track_duration without packet duration

Alfred E. Heggestad alfred.heggestad at gmail.com
Mon Jun 17 11:07:29 EEST 2019


 From c69b63a7af5531257753754e64ac33b7ef530e75 Mon Sep 17 00:00:00 2001
From: "Alfred E. Heggestad" <alfred.heggestad at gmail.com>
Date: Mon, 17 Jun 2019 10:04:08 +0200
Subject: [PATCH] movenc: calculate track_duration without packet duration

---
  libavformat/movenc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 46d314ff17..fa5833962b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5486,7 +5486,7 @@ int ff_mov_write_packet(AVFormatContext *s, 
AVPacket *pkt)
                     "this case.\n",
                     pkt->stream_index, pkt->dts);
      }
-    trk->track_duration = pkt->dts - trk->start_dts + pkt->duration;
+    trk->track_duration = pkt->dts - trk->start_dts;
      trk->last_sample_is_subtitle_end = 0;

      if (pkt->pts == AV_NOPTS_VALUE) {
-- 
2.20.1 (Apple Git-117)



More information about the ffmpeg-devel mailing list