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

Gyan ffmpeg at gyani.pro
Mon Jun 17 11:23:39 EEST 2019



On 17-06-2019 01:37 PM, Alfred E. Heggestad wrote:
> 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;

Why?

> trk->last_sample_is_subtitle_end = 0;
>
>      if (pkt->pts == AV_NOPTS_VALUE) {

Gyan


More information about the ffmpeg-devel mailing list