summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-12-21 18:18:24 +0100
committerwm4 <wm4@nowhere>2016-12-21 18:18:24 +0100
commitb1c0bbe8b8b9d25c2682f29af66ad243e0072897 (patch)
tree73a024a69fdfa3707de4e18962e4e1af02226c6d /video/decode/vd_lavc.c
parent1ba352581687548ffc2664b94f831a3dd12d05fa (diff)
downloadmpv-b1c0bbe8b8b9d25c2682f29af66ad243e0072897.tar.bz2
mpv-b1c0bbe8b8b9d25c2682f29af66ad243e0072897.tar.xz
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.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c5
1 files changed, 5 insertions, 0 deletions
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, &params);
mp_image_set_params(mpi, &params);