diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-05-25 10:41:54 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-05-25 10:41:54 +0400 |
commit | de80953667abbfa39600814385f710428c70f983 (patch) | |
tree | 23368c43fc3bff9288b072c60b179284a07f42d2 /decoder | |
parent | 33f989c8024aba5700d88df5810d288da38fb315 (diff) |
Use av_cpu_count
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)); |