summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ffmpeg_examiner.cc3
-rw-r--r--src/lib/ffmpeg_file_encoder.cc3
-rw-r--r--src/lib/util.cc2
-rw-r--r--wscript13
4 files changed, 20 insertions, 1 deletions
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 <libavformat/avformat.h>
#include <libavutil/pixfmt.h>
#include <libavutil/pixdesc.h>
-#include <libavutil/eval.h>
+#include <libavutil/channel_layout.h>
#include <libavutil/display.h>
+#include <libavutil/eval.h>
}
DCPOMATIC_ENABLE_WARNINGS
#include <iostream>
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 <libavutil/channel_layout.h>
+}
#include <iostream>
#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 <libavformat/avformat.h>\n
+ #include <libavfilter/avfilter.h>\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'] = []