Skip to content

Commit 7a7c655

Browse files
committed
MediaEngine: adjust for AVStream.codec deprecation
1 parent 5c5fa8d commit 7a7c655

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Core/HW/MediaEngine.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,14 @@ bool MediaEngine::setVideoStream(int streamNum, bool force) {
455455
return false;
456456
}
457457
AVCodecContext *m_pCodecCtx = m_pFormatCtx->streams[streamNum]->codec;
458+
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57,33,100)
459+
AVCodecParameters *m_pCodecPar = m_pFormatCtx->streams[streamNum]->codecpar;
460+
461+
// Update from deprecated public codec context
462+
if (avcodec_parameters_from_context(m_pCodecPar, m_pCodecCtx) < 0) {
463+
return false;
464+
}
465+
#endif
458466

459467
// Find the decoder for the video stream
460468
AVCodec *pCodec = avcodec_find_decoder(m_pCodecCtx->codec_id);

0 commit comments

Comments
 (0)