From 037588daf5631a79c4036235205a10bd100c4356 Mon Sep 17 00:00:00 2001 From: xufuji456 Date: Fri, 27 May 2022 09:09:31 +0800 Subject: [PATCH] Feature: using multi-thread to decode --- app/src/main/cpp/metadata/ffmpeg_media_retriever.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/cpp/metadata/ffmpeg_media_retriever.c b/app/src/main/cpp/metadata/ffmpeg_media_retriever.c index 70fa3d7..76ff4af 100755 --- a/app/src/main/cpp/metadata/ffmpeg_media_retriever.c +++ b/app/src/main/cpp/metadata/ffmpeg_media_retriever.c @@ -192,6 +192,8 @@ int set_data_source_inner(State **state_ptr, const char* path) { if (video_index >= 0) { stream_component_open(state, video_index); + state->codecCtx->thread_count = 3; // using multi-thread to decode + state->codecCtx->thread_type = FF_THREAD_FRAME; // FF_THREAD_SLICE } set_duration(state->pFormatCtx);