From 7a7c655615a4f607ea2e6bc58dc8ca3e4b535eca Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Wed, 13 Jun 2018 11:51:43 +0000 Subject: [PATCH] MediaEngine: adjust for AVStream.codec deprecation --- Core/HW/MediaEngine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index 1da8800240aa..62832f65c92f 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -455,6 +455,14 @@ bool MediaEngine::setVideoStream(int streamNum, bool force) { return false; } AVCodecContext *m_pCodecCtx = m_pFormatCtx->streams[streamNum]->codec; +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57,33,100) + AVCodecParameters *m_pCodecPar = m_pFormatCtx->streams[streamNum]->codecpar; + + // Update from deprecated public codec context + if (avcodec_parameters_from_context(m_pCodecPar, m_pCodecCtx) < 0) { + return false; + } +#endif // Find the decoder for the video stream AVCodec *pCodec = avcodec_find_decoder(m_pCodecCtx->codec_id);