From: Carl Hetherington Date: Sun, 28 Feb 2021 20:50:49 +0000 (+0100) Subject: Enable multi-threaded decoding with FFmpeg (helps with #1887). X-Git-Tag: v2.15.133~16 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=981f76a38547b30e67b94eb1c98308edf65d76ef;hp=f14a834eaa52f10b444995d177c504cc0a5ae0ee;p=dcpomatic.git Enable multi-threaded decoding with FFmpeg (helps with #1887). --- diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 0e70d9c6f..f8398763e 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -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) {