diff options
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/LAVPixFmtConverter.cpp | 4 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/avcodec.cpp | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/decoder/LAVVideo/LAVPixFmtConverter.cpp b/decoder/LAVVideo/LAVPixFmtConverter.cpp index bcf96356..5c690f98 100644 --- a/decoder/LAVVideo/LAVPixFmtConverter.cpp +++ b/decoder/LAVVideo/LAVPixFmtConverter.cpp @@ -154,9 +154,7 @@ CLAVPixFmtConverter::CLAVPixFmtConverter() { convert = &CLAVPixFmtConverter::convert_generic; - SYSTEM_INFO systemInfo; - GetSystemInfo(&systemInfo); - m_NumThreads = min(8, max(1, systemInfo.dwNumberOfProcessors / 2)); + m_NumThreads = min(8, max(1, av_cpu_count() / 2)); ZeroMemory(&m_ColorProps, sizeof(m_ColorProps)); } diff --git a/decoder/LAVVideo/decoders/avcodec.cpp b/decoder/LAVVideo/decoders/avcodec.cpp index b3411e86..5d77293a 100644 --- a/decoder/LAVVideo/decoders/avcodec.cpp +++ b/decoder/LAVVideo/decoders/avcodec.cpp @@ -398,9 +398,7 @@ STDMETHODIMP CDecAvcodec::InitDecoder(AVCodecID codec, const CMediaType *pmt) // Thread Count. 0 = auto detect int thread_count = m_pSettings->GetNumThreads(); if (thread_count == 0) { - SYSTEM_INFO systemInfo; - GetSystemInfo(&systemInfo); - thread_count = systemInfo.dwNumberOfProcessors * 3 / 2; + thread_count = av_cpu_count() * 3 / 2; } m_pAVCtx->thread_count = max(1, min(thread_count, AVCODEC_MAX_THREADS)); |