@@ -83,8 +83,46 @@ index c092b76..36a6cf1 100644
8383
8484EOF
8585
86+ cat << 'EOF ' >> pre-7.1-ffmpeg.patch
87+ diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp
88+ index 935ddf324b0..d4eed01d599 100644
89+ --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp
90+ +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp
91+ @@ -405,7 +405,7 @@ void MovieTexture_FFMpeg::RegisterProtocols()
92+ return;
93+ Done = true;
94+
95+ -#if !FF_API_NEXT
96+ +#if LIBAVCODEC_VERSION_MAJOR < 58
97+ avcodec::avcodec_register_all();
98+ avcodec::av_register_all();
99+ #endif
100+ @@ -508,7 +508,7 @@ RString MovieDecoder_FFMpeg::OpenCodec()
101+ if( m_pStreamCodec->codec )
102+ avcodec::avcodec_close( m_pStreamCodec );
103+
104+ - avcodec::AVCodec *pCodec = avcodec::avcodec_find_decoder( m_pStreamCodec->codec_id );
105+ + const avcodec::AVCodec *pCodec = avcodec::avcodec_find_decoder( m_pStreamCodec->codec_id );
106+ if( pCodec == nullptr )
107+ return ssprintf( "Couldn't find decoder %i", m_pStreamCodec->codec_id );
108+
109+ diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.h b/src/arch/MovieTexture/MovieTexture_FFMpeg.h
110+ index c092b765fc2..99f5ffcb1be 100644
111+ --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.h
112+ +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.h
113+ @@ -13,6 +13,7 @@ namespace avcodec
114+ #include <libavformat/avformat.h>
115+ #include <libswscale/swscale.h>
116+ #include <libavutil/pixdesc.h>
117+ + #include <libavcodec/avcodec.h>
118+
119+ #if LIBAVCODEC_VERSION_MAJOR >= 57
120+ #define av_free_packet av_packet_unref
121+
122+ EOF
123+
86124# minor edits from https://github.com/h-lunah/stepmania-ddr/commit/46ad6dae13d9c2786147a38bfbd3b3812573ad22.patch
87- cat << 'EOF ' >> newer -ffmpeg.patch
125+ cat << 'EOF ' >> 7.1 -ffmpeg.patch
88126diff --git a/src/CMakeData-arch.cmake b/src/CMakeData-arch.cmake
89127index 1c330a50bbc..6c3a6f24865 100644
90128--- a/src/CMakeData-arch.cmake
@@ -151,7 +189,13 @@ index c092b765fc2..99f5ffcb1be 100644
151189EOF
152190
153191git apply 0001-patch-upstream-for-ARM.patch || error " Applying patch failed"
154- git apply newer-ffmpeg.patch || error " Applying patch failed"
192+
193+ ffmpeg_version=" $( package_latest_version ffmpeg | awk -F' [:.-]' ' {print $2 $3}' ) "
194+ if [ " $ffmpeg_version " -ge 71 ] ; then
195+ git apply 7.1-ffmpeg.patch || error " Applying patch failed"
196+ else
197+ git apply pre-7.1-ffmpeg.patch || error " Applying patch failed"
198+ fi
155199
156200mkdir build && cd build || error " Could not create or enter build directory"
157201status " Running cmake"
0 commit comments