Open brad0 opened 2 years ago
I also hit this when trying to build the current head (commit a1984e4f6519b1376ac030d8c6b11c3aff1dcae6) for Fedora 36. With the following patch I could build it. I'm not at all sure this is the correct way to fix things though, so I only mention it here as a comment rather than making a PR.
--- ./src/CMakeData-arch.cmake~ 2022-03-25 17:31:58.000000000 +0100
+++ ./src/CMakeData-arch.cmake 2022-04-10 13:26:14.000000000 +0200
@@ -105,6 +105,7 @@
"arch/MovieTexture/MovieTexture_FFMpeg.cpp")
list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_HPP
"arch/MovieTexture/MovieTexture_FFMpeg.h")
+ add_compile_definitions(FF_API_NEXT)
endif()
endif()
--- ./src/arch/MovieTexture/MovieTexture_FFMpeg.h~ 2022-03-25 17:31:58.000000000 +0100
+++ ./src/arch/MovieTexture/MovieTexture_FFMpeg.h 2022-04-10 13:09:01.000000000 +0200
@@ -13,6 +13,7 @@
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavutil/pixdesc.h>
+ #include <libavcodec/avcodec.h>
#if LIBAVCODEC_VERSION_MAJOR >= 58
#define av_free_packet av_packet_unref
--- ./src/arch/MovieTexture/MovieTexture_FFMpeg.cpp~ 2022-03-25 17:31:58.000000000 +0100
+++ ./src/arch/MovieTexture/MovieTexture_FFMpeg.cpp 2022-04-10 13:32:11.000000000 +0200
@@ -494,7 +494,7 @@
if( m_pStreamCodec->codec )
avcodec::avcodec_close( m_pStreamCodec );
- avcodec::AVCodec *pCodec = avcodec::avcodec_find_decoder( m_pStreamCodec->codec_id );
+ const avcodec::AVCodec *pCodec = avcodec::avcodec_find_decoder( m_pStreamCodec->codec_id );
if( pCodec == nullptr )
return ssprintf( "Couldn't find decoder %i", m_pStreamCodec->codec_id );
Hi!
I also had to apply @goeranu's patch to be able to build with system FFMPEG 5.x (default on Ubuntu Kinetic (22.10)).
I also tested it afterwards and everything seemed to be fine.
I created a PR that allows building against current releases and newer releases of FFmpeg.
Any feedback would be welcome.
Does not build with FFmpeg 5.0.