Merged 15170:15635 from trunk (no conflicts or even merges)
[blender.git] / source / blender / render / intern / source / pipeline.c
index ebb52c491323d2f71141f43dd9781004c3c79b96..6a0af82b4d7373e0096786f9f3a5353314d52c90 100644 (file)
@@ -2675,9 +2675,9 @@ void RE_set_max_threads(int threads)
 
 void RE_init_threadcount(Render *re) 
 {
-       if ((re->r.mode & R_FIXED_THREADS)==0 || commandline_threads == 0) { /* Automatic threads */
+        if(commandline_threads >= 1) { /* only set as an arg in background mode */
+               re->r.threads= MIN2(commandline_threads, BLENDER_MAX_THREADS);
+       } else if ((re->r.mode & R_FIXED_THREADS)==0 || commandline_threads == 0) { /* Automatic threads */
                re->r.threads = BLI_system_thread_count();
-       } else if(commandline_threads >= 1 && commandline_threads<=BLENDER_MAX_THREADS) {
-               re->r.threads= commandline_threads;
        }
 }