Fixed some compiler errors when building with FFmpeg 5.0

This commit is contained in:
Leon Styhre 2022-03-06 14:38:19 +01:00
parent afc99d374c
commit 2df8a867ad
2 changed files with 6 additions and 0 deletions

View file

@ -1281,8 +1281,13 @@ void VideoFFmpegComponent::startVideoStream()
bool hwDecoding = false; bool hwDecoding = false;
#endif #endif
#if LIBAVUTIL_VERSION_MAJOR > 56
mVideoStreamIndex = av_find_best_stream(mFormatContext, AVMEDIA_TYPE_VIDEO, -1, -1,
const_cast<const AVCodec**>(&mHardwareCodec), 0);
#else
mVideoStreamIndex = mVideoStreamIndex =
av_find_best_stream(mFormatContext, AVMEDIA_TYPE_VIDEO, -1, -1, &mHardwareCodec, 0); av_find_best_stream(mFormatContext, AVMEDIA_TYPE_VIDEO, -1, -1, &mHardwareCodec, 0);
#endif
if (mVideoStreamIndex < 0) { if (mVideoStreamIndex < 0) {
LOG(LogError) << "VideoFFmpegComponent::startVideoStream(): " LOG(LogError) << "VideoFFmpegComponent::startVideoStream(): "

View file

@ -20,6 +20,7 @@ extern "C" {
#include <libavfilter/buffersink.h> #include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h> #include <libavfilter/buffersrc.h>
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavutil/channel_layout.h>
#include <libavutil/imgutils.h> #include <libavutil/imgutils.h>
} }