Commit 04fc5ff6 authored by Laurent Aimar's avatar Laurent Aimar Committed by Jean-Baptiste Kempf

Improved default threads count when using automatic mode in avcodec.

(cherry picked from commit 87e9c403dece6d0c347d7314402f1919cb36b859)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 7029ccb8
......@@ -336,7 +336,11 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
#ifdef HAVE_AVCODEC_MT
int i_thread_count = var_InheritInteger( p_dec, "ffmpeg-threads" );
if( i_thread_count <= 0 )
{
i_thread_count = vlc_GetCPUCount();
if( i_thread_count > 1 )
i_thread_count++;
}
i_thread_count = __MIN( i_thread_count, 16 );
msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count );
p_sys->p_context->thread_count = i_thread_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment