mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Use fewer threads on 32-bit to save memory
This commit is contained in:
parent
8a942a21dd
commit
0b1a801b7e
|
@ -98,9 +98,16 @@ void CVideo::Start()
|
|||
|
||||
m_pFormat = m_pFormatContext->oformat;
|
||||
|
||||
#if defined(CONF_ARCH_IA32) || defined(CONF_ARCH_ARM)
|
||||
// use only the minimum of 2 threads on 32-bit to save memory
|
||||
m_VideoThreads = 2;
|
||||
m_AudioThreads = 2;
|
||||
#else
|
||||
m_VideoThreads = std::thread::hardware_concurrency() + 2;
|
||||
// audio gets a bit less
|
||||
m_AudioThreads = (std::thread::hardware_concurrency() / 2) + 2;
|
||||
#endif
|
||||
|
||||
m_CurVideoThreadIndex = 0;
|
||||
m_CurAudioThreadIndex = 0;
|
||||
|
||||
|
@ -819,6 +826,11 @@ bool CVideo::AddStream(OutputStream *pStream, AVFormatContext *pOC, const AVCode
|
|||
}
|
||||
pStream->pEnc = c;
|
||||
|
||||
#if defined(CONF_ARCH_IA32) || defined(CONF_ARCH_ARM)
|
||||
// use only 1 ffmpeg thread on 32-bit to save memory
|
||||
c->thread_count = 1;
|
||||
#endif
|
||||
|
||||
switch((*ppCodec)->type)
|
||||
{
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
|
|
Loading…
Reference in a new issue