File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -462,11 +462,13 @@ int main(int argc, char **argv)
462
462
#if LIBFLAC_ENABLED == 1 && defined(FLAC_API_VERSION_CURRENT ) && FLAC_API_VERSION_CURRENT >= 14
463
463
if (flac_threads == 0 ) {
464
464
int out_cnt = ((output_names [0 ] == NULL ) ? 0 : 1 ) + ((output_names [1 ] == NULL ) ? 0 : 1 );
465
- flac_threads = get_num_cores ();
466
- fprintf (stderr ,"Detected %d cores in the system available to the process\n" ,flac_threads );
467
- flac_threads = (flac_threads - 2 - out_cnt ) / out_cnt ;
468
- if (flac_threads == 0 ) flac_threads = 1 ;
469
- if (flac_threads > 128 ) flac_threads = 128 ;
465
+ if (out_cnt != 0 ) {
466
+ flac_threads = get_num_cores ();
467
+ fprintf (stderr ,"Detected %d cores in the system available to the process\n" ,flac_threads );
468
+ flac_threads = (flac_threads - 2 - out_cnt ) / out_cnt ;
469
+ if (flac_threads == 0 ) flac_threads = 1 ;
470
+ if (flac_threads > 128 ) flac_threads = 128 ;
471
+ }
470
472
}
471
473
#endif
472
474
You can’t perform that action at this time.
0 commit comments