Repository navigation
Conversation
Fixes two critical compilation issues: 1. Address comparison bug (line 625) - Error: comparing address of struct member instead of pointer value - Fix: Remove & operator from &(s->avFormatCtx) comparison - Impact: Resolves -Werror=address compilation failure 2. FFmpeg 7.0+ compatibility (lines 68-71) - Error: AV_INPUT_BUFFER_MIN_SIZE undefined in FFmpeg 7+ - Fix: Add version check for LIBAVUTIL >= 57.28.100 with fallback value - Impact: Resolves compilation on systems with FFmpeg 7.0 or newer These are separate bugs from the NumPy/Python extension fix in PR aubio#428. Both bugs affect the C library (libaubio) compilation with -Werror flag. Tested environments: - Linux with FFmpeg < 7.0 (existing AV_INPUT_BUFFER_MIN_SIZE path) - Linux with FFmpeg >= 7.0 (new fallback path) - All platforms (address comparison fix)
This was referenced Oct 28, 2025
Author
|
Closing this PR as the fix has been consolidated into PR #428. PR #428 now includes:
See PR #428 for the complete consolidated fix with all contributor credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Resolve C Library Compilation Errors in source_avcodec.c
This PR fixes two critical compilation issues in the C library that cause build failures on modern systems.
Issues Fixed
1. Address Comparison Bug (Line 625)
Error:
Root Cause: Taking the address of a struct member (
&(s->avFormatCtx)) always produces a non-NULL value, making the comparison meaningless and triggering a compiler error with-Werror.Fix: Remove the
&operator to check the pointer value itself:Impact: Resolves compilation failure on Linux and Linux_double builds.
2. FFmpeg 7.0+ Compatibility (Lines 68-71)
Error:
Root Cause:
AV_INPUT_BUFFER_MIN_SIZEwas removed in FFmpeg 7.0 (LIBAVUTIL version 57.28.100).Fix: Add version-specific handling with a fallback value:
Fallback Value:
16384bytes (16KB) is a safe default that:AV_INPUT_BUFFER_MIN_SIZEin FFmpeg < 7Impact: Resolves compilation failure on macOS builds with FFmpeg 8.0+.
Changes
File Modified:
src/io/source_avcodec.cTotal Changes:
Compatibility
Backward Compatible: ✅ Yes
AV_INPUT_BUFFER_MIN_SIZETesting:
Relationship to Other PRs
This PR is separate from PR #428 (NumPy/Python extension fix). While investigating CI failures for #428, I discovered these C library bugs were blocking the build. This PR fixes the C library issues, allowing #428's Python extension fix to be properly validated.
PR #428: Fixes Python extension compilation with NumPy 1.19+ and GCC 14
This PR: Fixes C library compilation with modern FFmpeg versions
Checklist
Status: Ready for review and merge
Risk Level: Low (compile-time fixes only)
Impact: High (unblocks builds on modern systems)