Skip to content

Commit b77542c

Browse files
blaztinnillwieckz
authored andcommitted
Use max 16 threads
The commit `4bb735f7966eedf414aa8e24533967cffd5bbcdb` only fixed the threading limit on the decoder part. Use the limit also in the encoder.
1 parent 857ecc7 commit b77542c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

crnlib/crn_threading_pthreads.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void crn_threading_init() {
3838
#else
3939
g_number_of_processors = 1;
4040
#endif
41+
g_number_of_processors = math::minimum<int>(g_number_of_processors, task_pool::cMaxThreads);
4142
}
4243

4344
crn_thread_id_t crn_get_current_thread_id() {

crnlib/crn_threading_win32.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ void crn_threading_init() {
1313
GetSystemInfo(&g_system_info);
1414

1515
g_number_of_processors = math::maximum<uint>(1U, g_system_info.dwNumberOfProcessors);
16+
g_number_of_processors = math::minimum<int>(g_number_of_processors, task_pool::cMaxThreads);
1617
}
1718

1819
crn_thread_id_t crn_get_current_thread_id() {

0 commit comments

Comments
 (0)