[FFmpeg-devel] [PATCH] libavfilter: Fix implicit declarations of av_cpu_max_align

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Aug 4 16:30:15 EEST 2021


Martin Storsjö:
> ---
>  libavfilter/af_afftfilt.c       | 1 +
>  libavfilter/avf_showspectrum.c  | 1 +
>  libavfilter/vaf_spectrumsynth.c | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c
> index 3e69c636c8..877ccc5be0 100644
> --- a/libavfilter/af_afftfilt.c
> +++ b/libavfilter/af_afftfilt.c
> @@ -22,6 +22,7 @@
>  #include "libavutil/avstring.h"
>  #include "libavfilter/internal.h"
>  #include "libavutil/common.h"
> +#include "libavutil/cpu.h"
>  #include "libavutil/opt.h"
>  #include "libavutil/eval.h"
>  #include "libavutil/tx.h"
> diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
> index 9f3ade36f4..52bad5b2ad 100644
> --- a/libavfilter/avf_showspectrum.c
> +++ b/libavfilter/avf_showspectrum.c
> @@ -33,6 +33,7 @@
>  #include "libavutil/avassert.h"
>  #include "libavutil/avstring.h"
>  #include "libavutil/channel_layout.h"
> +#include "libavutil/cpu.h"
>  #include "libavutil/opt.h"
>  #include "libavutil/parseutils.h"
>  #include "libavutil/xga_font_data.h"
> diff --git a/libavfilter/vaf_spectrumsynth.c b/libavfilter/vaf_spectrumsynth.c
> index cf76f4e4c7..d44d01cd33 100644
> --- a/libavfilter/vaf_spectrumsynth.c
> +++ b/libavfilter/vaf_spectrumsynth.c
> @@ -27,6 +27,7 @@
>  #include "libavutil/tx.h"
>  #include "libavutil/avassert.h"
>  #include "libavutil/channel_layout.h"
> +#include "libavutil/cpu.h"
>  #include "libavutil/ffmath.h"
>  #include "libavutil/opt.h"
>  #include "libavutil/parseutils.h"
> 
LGTM.
Btw: I am working on a branch
https://github.com/mkver/FFmpeg/commits/headers3 which includes a patch
https://github.com/mkver/FFmpeg/commit/c76d83e6f1c09dc8787760cb11ea0eac90d2ff59
which makes emms_c.h no longer include cpu.h if it is not needed. This
will remove cpu.h inclusions on x64 and therefore avoid a repeat of this
situation (unless there is a dev whose main system is 32bit x86).

- Andreas

PS: It is not good to put av_cpu_max_align() inside macros which
evaluate its argument multiple times. (In case we would some day at a
function that allows to force the maximum alignment, the result could
even be inconsistent.)


More information about the ffmpeg-devel mailing list