From 716d747b5ac956d5fff017f32b07552112b19a1e Mon Sep 17 00:00:00 2001 From: Javernaut Date: Fri, 22 Nov 2019 19:32:49 +0200 Subject: [PATCH] Using number of cores to set the number of threads --- ffmpeg-android-maker.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ffmpeg-android-maker.sh b/ffmpeg-android-maker.sh index 3e0c64f..19063ab 100755 --- a/ffmpeg-android-maker.sh +++ b/ffmpeg-android-maker.sh @@ -15,6 +15,12 @@ case "$OSTYPE" in ;; esac +if [[ $OSTYPE == "darwin"* ]]; then + NPROC=$(sysctl -n hw.physicalcpu) +else + NPROC=$(nproc) +fi + # Directories used by the script BASE_DIR="$( cd "$( dirname "$0" )" && pwd )" SOURCES_DIR=${BASE_DIR}/sources @@ -185,7 +191,7 @@ function assemble() { --disable-bsfs make clean - make -j8 + make -j${NPROC} make install # Saving stats about text relocation presence.