summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2022-11-29 11:18:12 -0800
committerPhilip Langdale <github.philipl@overt.org>2022-12-01 10:45:47 -0800
commit83257be693967415f1160f2fa37de9de677c1cab (patch)
tree9b26b6cfdfbf99af59ff554a8d69602902cb73ac /video/decode
parent70683b891672aba401c111e4afc599ca230d7314 (diff)
downloadmpv-83257be693967415f1160f2fa37de9de677c1cab.tar.bz2
mpv-83257be693967415f1160f2fa37de9de677c1cab.tar.xz
vd_lavc: update to handle deprecation of `pkt_duration`
This has been replaced by `duration`.
Diffstat (limited to 'video/decode')
-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 4f38b669ec..c65d9d708a 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -23,6 +23,7 @@
#include <stdbool.h>
#include <libavcodec/avcodec.h>
+#include <libavformat/version.h>
#include <libavutil/common.h>
#include <libavutil/hwcontext.h>
#include <libavutil/opt.h>
@@ -1153,7 +1154,11 @@ static int decode_frame(struct mp_filter *vd)
mpi->dts = mp_pts_from_av(ctx->pic->pkt_dts, &ctx->codec_timebase);
mpi->pkt_duration =
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(59, 30, 100)
+ mp_pts_from_av(ctx->pic->duration, &ctx->codec_timebase);
+#else
mp_pts_from_av(ctx->pic->pkt_duration, &ctx->codec_timebase);
+#endif
av_frame_unref(ctx->pic);