Enable multi-threaded decoding with FFmpeg (helps with #1887).
authorCarl Hetherington <cth@carlh.net>
Sun, 28 Feb 2021 20:50:49 +0000 (21:50 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 28 Feb 2021 20:50:49 +0000 (21:50 +0100)
src/lib/ffmpeg.cc

index 0e70d9c6f89350f12e5e1ffba1573f2d3af5aed2..f8398763e8185c59b096a7c9484844dedc5400a0 100644 (file)
@@ -203,6 +203,9 @@ DCPOMATIC_DISABLE_WARNINGS
        for (uint32_t i = 0; i < _format_context->nb_streams; ++i) {
                auto context = _format_context->streams[i]->codec;
 
+               context->thread_count = 8;
+               context->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE;
+
                AVCodec* codec = avcodec_find_decoder (context->codec_id);
                if (codec) {