summaryrefslogtreecommitdiff
path: root/libavcodec/pthread_slice.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-21 00:36:51 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-21 00:56:11 +0100
commita53fbda9dc92273054a103db7539d2bb6e9632b2 (patch)
tree90fd4e9667823cd69ac15c4b243c62b0cb179524 /libavcodec/pthread_slice.c
parenta36201564163a267644f1b5bc58fca0e3c25a9fa (diff)
downloadffmpeg-a53fbda9dc92273054a103db7539d2bb6e9632b2.tar.gz
avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
Cleaner solution is welcome! Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/pthread_slice.c')
-rw-r--r--libavcodec/pthread_slice.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/pthread_slice.c b/libavcodec/pthread_slice.c
index 3ba5c665ad..96a7643f6a 100644
--- a/libavcodec/pthread_slice.c
+++ b/libavcodec/pthread_slice.c
@@ -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)