From 26e168c96c057642e4d071934aae74df3cda4348 Mon Sep 17 00:00:00 2001 From: Peter Keuter Date: Mon, 6 Jun 2022 19:54:47 +0200 Subject: [PATCH 1/2] fix: added bsf headers on ffmpeg 5+ --- build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.rs b/build.rs index 68adda1..3ae8df5 100644 --- a/build.rs +++ b/build.rs @@ -1176,6 +1176,9 @@ fn main() { .header(search_include(&include_paths, "libavcodec/avfft.h")) .header(search_include(&include_paths, "libavcodec/vorbis_parser.h")); + if ffmpeg_major_version >= 5 { + builder = builder.header(search_include(&include_paths, "libavcodec/bsf.h")) + } if ffmpeg_major_version < 5 { builder = builder.header(search_include(&include_paths, "libavcodec/vaapi.h")) } From cf56bc8d964f9caa13c5478d405fa4bb5875366a Mon Sep 17 00:00:00 2001 From: Peter Keuter Date: Wed, 8 Jun 2022 11:02:07 +0200 Subject: [PATCH 2/2] fix: make bsf header optional --- build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 3ae8df5..3d7407f 100644 --- a/build.rs +++ b/build.rs @@ -1177,8 +1177,11 @@ fn main() { .header(search_include(&include_paths, "libavcodec/vorbis_parser.h")); if ffmpeg_major_version >= 5 { - builder = builder.header(search_include(&include_paths, "libavcodec/bsf.h")) + if let Some(bsf_header) = maybe_search_include(&include_paths, "libavcodec/bsf.h") { + builder = builder.header(bsf_header); + } } + if ffmpeg_major_version < 5 { builder = builder.header(search_include(&include_paths, "libavcodec/vaapi.h")) }