fix(build): skip avfft.h for FFmpeg >= 8 (removed upstream)#125
fix(build): skip avfft.h for FFmpeg >= 8 (removed upstream)#125gaurav02081 wants to merge 1 commit intozmwangx:masterfrom
Conversation
was deprecated in FFmpeg 6.0 and removed in FFmpeg 8.0. The previous exists-based guard relied on search_include fallback behavior. Gate inclusion on and use for safe lookup, matching the existing vaapi.h version guard pattern. Fixes zmwangx#117.
bfe6d24 to
f39113f
Compare
|
Any known workarounds for this? For reference, I am trying to compile https://github.com/russelltg/wl-screenrec |
Until this PR is merged, you can work around it by using my fork directly. In the [patch.crates-io] This will use the patched build.rs that skips avfft.h on FFmpeg >= 8. |
$env.BINDGEN_EXTRA_CLANG_ARGS = "--target=x86_64-unknown-linux-gnu -D__float128='long double'"This fixed the compilation issue :) Unfortunately it seems my nvidia+intel laptop does not want to use libva/vaapi, but that's another issue. |






Problem
libavcodec/avfft.hwas deprecated in FFmpeg 6.0 (lavc 60.25.100) andremoved in FFmpeg 8.0. Building against FFmpeg ≥ 8 could fail depending
on include path resolution behavior.
The previous implementation relied on an
exists()guard aftersearch_include, which depended on fallback filesystem behavior ratherthan explicit version semantics.
Fixes #117.
Solution
libavcodec/avfft.honffmpeg_major_version < 8maybe_search_includehelper for safe lookupvaapi.hThis removes reliance on filesystem fallback behavior and makes the
intent explicit and consistent with existing header guards.
Testing
Tested on macOS with FFmpeg 8.0.1 (Homebrew):
cargo buildsucceedsavfft.his not included in bindgen outputavfftsymbols appear in generatedbindings.rsThis preserves compatibility for users building against older FFmpeg
versions while ensuring clean builds with FFmpeg 8+.