diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-14 21:11:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-23 01:38:47 +0200 |
commit | 0c851e464229f50c440968c4c94b672e23f691af (patch) | |
tree | 7c75408781f2aa31e2e842f0e9e7a566deab2567 /libavcodec/pthread.c | |
parent | 094c5e6c55238416b273711ff176dea4cfd3ce5b (diff) | |
download | ffmpeg-0c851e464229f50c440968c4c94b672e23f691af.tar.gz |
threads: make get_logical_cpus() available outside pthread.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r-- | libavcodec/pthread.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 4d84d4ce9d..7f2ea09a74 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -160,7 +160,7 @@ typedef struct FrameThreadContext { * limit the number of threads to 16 for automatic detection */ #define MAX_AUTO_THREADS 16 -static int get_logical_cpus(AVCodecContext *avctx) +int ff_get_logical_cpus(AVCodecContext *avctx) { int ret, nb_cpus = 1; #if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT) @@ -303,7 +303,7 @@ static int thread_init(AVCodecContext *avctx) int thread_count = avctx->thread_count; if (!thread_count) { - int nb_cpus = get_logical_cpus(avctx); + int nb_cpus = ff_get_logical_cpus(avctx); // use number of cores + 1 as thread count if there is more than one if (nb_cpus > 1) thread_count = avctx->thread_count = FFMIN(nb_cpus + 1, MAX_AUTO_THREADS); @@ -799,7 +799,7 @@ static int frame_thread_init(AVCodecContext *avctx) int i, err = 0; if (!thread_count) { - int nb_cpus = get_logical_cpus(avctx); + int nb_cpus = ff_get_logical_cpus(avctx); if ((avctx->debug & (FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE)) || avctx->debug_mv) nb_cpus = 1; // use number of cores + 1 as thread count if there is more than one |