From 139f6b5de738a3a4746c9dc991e0bee17bda4b17 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 17 Oct 2016 19:18:03 +0200 Subject: ad_lavc, vd_lavc: fix a recent libavcodec deprecation warning Both AVFrame.pts and AVFrame.pkt_pts have existed for a long time. Until now, decoders always returned the pts via the pkt_pts field, while the pts field was used for encoding and libavfilter only. Recently, pkt_pts was deprecated, and pts was switched to always carry the pts. This means we have to be careful not to accidentally use the wrong field, depending on the libavcodec version. We have to explicitly check the version numbers. Of course the version numbers are completely idiotic, because idiotically the pkg-config and library names are the same for FFmpeg and Libav, so we have to deal with this explicitly as well. --- video/decode/vd_lavc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 86cf815320..12e60483ee 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -861,7 +861,7 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, return; } assert(mpi->planes[0] || mpi->planes[3]); - mpi->pts = mp_pts_from_av(ctx->pic->pkt_pts, &ctx->codec_timebase); + mpi->pts = mp_pts_from_av(MP_AVFRAME_DEC_PTS(ctx->pic), &ctx->codec_timebase); mpi->dts = mp_pts_from_av(ctx->pic->pkt_dts, &ctx->codec_timebase); struct mp_image_params params; -- cgit v1.2.3