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:
parent
9c1f0493d5
commit
e404eee1e1
@ -189,6 +189,10 @@ static int get_logical_cpus(AVCodecContext *avctx)
|
|||||||
nb_cpus = sysconf(_SC_NPROCESSORS_ONLN);
|
nb_cpus = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
#endif
|
#endif
|
||||||
av_log(avctx, AV_LOG_DEBUG, "detected %d logical cores\n", nb_cpus);
|
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);
|
return FFMIN(nb_cpus, MAX_AUTO_THREADS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user