1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

pthread: Limit automatic threads to mb_height.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-01 01:21:31 +01:00
parent 9c1f0493d5
commit e404eee1e1

View File

@ -189,6 +189,10 @@ static int get_logical_cpus(AVCodecContext *avctx)
nb_cpus = sysconf(_SC_NPROCESSORS_ONLN);
#endif
av_log(avctx, AV_LOG_DEBUG, "detected %d logical cores\n", nb_cpus);
if (avctx->height)
nb_cpus = FFMIN(nb_cpus, (avctx->height+15)/16);
return FFMIN(nb_cpus, MAX_AUTO_THREADS);
}