From b1c0bbe8b8b9d25c2682f29af66ad243e0072897 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 21 Dec 2016 18:18:24 +0100 Subject: video: use demuxer-signaled duration for last video frame Helps with gif, probably does unwanted things with other formats. This doesn't handle --end quite correctly, but this could be added later. Fixes #3924. --- video/decode/vd_lavc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index cd3c611ebd..78d34bbb47 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -859,6 +859,11 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, mpi->pts = mp_pts_from_av(ctx->pic->pts, &ctx->codec_timebase); mpi->dts = mp_pts_from_av(ctx->pic->pkt_dts, &ctx->codec_timebase); +#if LIBAVCODEC_VERSION_MICRO >= 100 + mpi->pkt_duration = + mp_pts_from_av(av_frame_get_pkt_duration(ctx->pic), &ctx->codec_timebase); +#endif + struct mp_image_params params; update_image_params(vd, ctx->pic, ¶ms); mp_image_set_params(mpi, ¶ms); -- cgit v1.2.3