mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
Cleaner solution is welcome! Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a362015641
commit
a53fbda9dc
2 changed files with 6 additions and 3 deletions
|
|
@ -186,6 +186,12 @@ int ff_slice_thread_init(AVCodecContext *avctx)
|
|||
w32thread_init();
|
||||
#endif
|
||||
|
||||
// We cannot do this in the encoder init as the threads are created before
|
||||
if (av_codec_is_encoder(avctx->codec) &&
|
||||
avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO &&
|
||||
avctx->height > 2800)
|
||||
thread_count = avctx->thread_count = 1;
|
||||
|
||||
if (!thread_count) {
|
||||
int nb_cpus = av_cpu_count();
|
||||
if (avctx->height)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue