From: Carl Hetherington Date: Tue, 3 Aug 2021 19:24:51 +0000 (+0200) Subject: Fix build with newer FFmpeg. X-Git-Tag: v2.15.157~1 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=4e2ff7851127cd85c3e7d78b42eb884d0cda0ac3 Fix build with newer FFmpeg. --- diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index bd6a9b20d..853db90be 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -33,8 +33,9 @@ extern "C" { #include #include #include -#include +#include #include +#include } DCPOMATIC_ENABLE_WARNINGS #include diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc index 83e707725..533fd151c 100644 --- a/src/lib/ffmpeg_file_encoder.cc +++ b/src/lib/ffmpeg_file_encoder.cc @@ -29,6 +29,9 @@ #include "image.h" #include "cross.h" #include "compose.hpp" +extern "C" { +#include +} #include #include "i18n.h" diff --git a/src/lib/util.cc b/src/lib/util.cc index 2d2a63c35..4ce677bf6 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -367,10 +367,12 @@ dcpomatic_setup () SetUnhandledExceptionFilter(exception_handler); #endif +#ifdef DCPOMATIC_HAVE_AVREGISTER DCPOMATIC_DISABLE_WARNINGS av_register_all (); avfilter_register_all (); DCPOMATIC_ENABLE_WARNINGS +#endif #ifdef DCPOMATIC_OSX /* Add our library directory to the libltdl search path so that diff --git a/wscript b/wscript index b7ea7de6c..bfc84112d 100644 --- a/wscript +++ b/wscript @@ -437,6 +437,19 @@ def configure(conf): define_name='DCPOMATIC_HAVE_AVCOMPONENTDESCRIPTOR_DEPTH_MINUS1', mandatory=False) + # See if we have av_register_all and avfilter_register_all + conf.check_cxx(fragment=""" + extern "C" {\n + #include \n + #include \n + }\n + int main () { av_register_all(); avfilter_register_all(); }\n + """, + msg='Checking for av_register_all and avfilter_register_all', + uselib='AVFORMAT AVFILTER', + define_name='DCPOMATIC_HAVE_AVREGISTER', + mandatory=False) + # Hack: the previous two check_cxx calls end up copying their (necessary) cxxflags # to these variables. We don't want to use these for the actual build, so clean them out. conf.env['CXXFLAGS_AVCODEC'] = []