Skip to content

Commit

Permalink
dvdplayer: init ffmpeg threads like LAVFilters does
Browse files Browse the repository at this point in the history
backported/picked from d65dc65 (xbmc#9899)
  • Loading branch information
FernetMenta authored and herrnst committed Jun 3, 2016
1 parent 728ed6b commit 937991c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
}
else
{
int num_threads = std::min(8 /*MAX_THREADS*/, g_cpuInfo.getCPUCount());
if( num_threads > 1)
m_pCodecContext->thread_count = num_threads;
int num_threads = av_cpu_count() * 3 / 2;
num_threads = std::max(1, std::min(num_threads, 16));
m_pCodecContext->thread_count = num_threads;
m_pCodecContext->thread_safe_callbacks = 1;
m_decoderState = STATE_SW_MULTI;
CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg - open frame threaded with %d threads", num_threads);
Expand Down

0 comments on commit 937991c

Please sign in to comment.