summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-02-28 21:50:49 +0100
committerCarl Hetherington <cth@carlh.net>2021-02-28 21:50:49 +0100
commit981f76a38547b30e67b94eb1c98308edf65d76ef (patch)
treeb76680a92385bb03e5b6b66a9a6c4a3faa5b1517 /src/lib/ffmpeg.cc
parentf14a834eaa52f10b444995d177c504cc0a5ae0ee (diff)
Enable multi-threaded decoding with FFmpeg (helps with #1887).
Diffstat (limited to 'src/lib/ffmpeg.cc')
-rw-r--r--src/lib/ffmpeg.cc3
1 files changed, 3 insertions, 0 deletions
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) {