Skip to content

Commit

Permalink
Merge pull request #11176 from jbeich/ffmpeg
Browse files Browse the repository at this point in the history
Work around video corruption with system FFmpeg >= 3.1
  • Loading branch information
hrydgard authored Jun 13, 2018
2 parents 5c5fa8d + 7a7c655 commit 0fd4ea8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Core/HW/MediaEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0fd4ea8

Please sign in to comment.