0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

vd_lavc: update to handle deprecation of pkt_duration

This has been replaced by `duration`.
This commit is contained in:
Philip Langdale 2022-11-29 11:18:12 -08:00 committed by Philip Langdale
parent 70683b8916
commit 83257be693

View File

@ -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);