diff options
author | wm4 <wm4@nowhere> | 2016-10-17 19:18:03 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-10-17 19:18:03 +0200 |
commit | 139f6b5de738a3a4746c9dc991e0bee17bda4b17 (patch) | |
tree | 732dcaeb19b0cfc8c1437bcb6911661de0c00ee0 /audio/decode | |
parent | 118d7a310e4eacc657f6656bf5769d356bb45438 (diff) | |
download | mpv-139f6b5de738a3a4746c9dc991e0bee17bda4b17.tar.bz2 mpv-139f6b5de738a3a4746c9dc991e0bee17bda4b17.tar.xz |
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.
Diffstat (limited to 'audio/decode')
-rw-r--r-- | audio/decode/ad_lavc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index e5c426e912..e28558414d 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -245,7 +245,8 @@ static int decode_packet(struct dec_audio *da, struct demux_packet *mpkt, if (!got_frame) return 0; - double out_pts = mp_pts_from_av(priv->avframe->pkt_pts, &priv->codec_timebase); + double out_pts = mp_pts_from_av(MP_AVFRAME_DEC_PTS(priv->avframe), + &priv->codec_timebase); struct mp_audio *mpframe = mp_audio_from_avframe(priv->avframe); if (!mpframe) |