From c971220cdd360b56efc0e67536bdf19501477aa4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 31 Mar 2016 22:00:45 +0200 Subject: demux_lavf, ad_lavc, ad_spdif, vd_lavc: handle FFmpeg codecpar API change AVFormatContext.codec is deprecated now, and you're supposed to use AVFormatContext.codecpar instead. Handle this for all of the normal playback code. Encoding mode isn't touched. --- audio/decode/ad_lavc.c | 3 +-- audio/decode/ad_spdif.c | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'audio') diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index c5e6b09cd4..8a6bb4061b 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -131,8 +131,7 @@ static int init(struct dec_audio *da, const char *decoder) // demux_mkv mp_lavc_set_extradata(lavc_context, c->extradata, c->extradata_size); - if (c->lav_headers) - mp_copy_lav_codec_headers(lavc_context, c->lav_headers); + mp_set_lav_codec_headers(lavc_context, c); mp_set_avcodec_threads(da->log, lavc_context, opts->threads); diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c index 7298d9e7d7..eb2e2bb0a9 100644 --- a/audio/decode/ad_spdif.c +++ b/audio/decode/ad_spdif.c @@ -171,7 +171,11 @@ static int init_filter(struct dec_audio *da, AVPacket *pkt) if (!stream) goto fail; +#if HAVE_AVCODEC_HAS_CODECPAR + stream->codecpar->codec_id = spdif_ctx->codec_id; +#else stream->codec->codec_id = spdif_ctx->codec_id; +#endif AVDictionary *format_opts = NULL; -- cgit v1.2.3