[FFmpeg-devel] [PATCH] libavutil/cpu: Fix definition of _GNU_SOURCE so it occurs before other includes
Kevin Wheatley
kevin.j.wheatley at gmail.com
Mon Apr 26 14:32:32 EEST 2021
On Mon, Apr 12, 2021 at 12:22 PM <kevin.j.wheatley at gmail.com> wrote:
>
> From: Kevin Wheatley <kevin.j.wheatley at gmail.com>
>
> This fix moves the potential definition of _GNU_SOURCE prior to
> any includes of system header files as required by the documentation
> https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
>
> This corrects the CPU_COUNT macro availability, resulting in
> sched_getaffinity() being called on Linux systems. This then correctly
> returns the number of CPUs when run under containers and other cases
> where processor affinity has been setup prior to running FFmpeg
>
bump
As an FYI the issue is triggered because the inclusion of the other
system headers prior to the _GNU_SOURCE definition results in the
CPU_COUNT macro not being defined, and so the affinity based CPU
counting fails to be used and so the cpu count is incorrectly
returned.
Kevin
More information about the ffmpeg-devel
mailing list