@@ -404,7 +404,6 @@ ow_resampler_compute_ratios (struct ow_resampler *resampler,
404404{
405405 ow_engine_status_t engine_status ;
406406 struct ow_dll * dll = & resampler -> dll ;
407- static uint64_t booting_start_usecs , tuning_start_usecs ;
408407 ow_resampler_status_t status ;
409408
410409 engine_status = ow_engine_get_status (resampler -> engine );
@@ -458,7 +457,7 @@ ow_resampler_compute_ratios (struct ow_resampler *resampler,
458457 ow_resampler_set_status (resampler , OW_RESAMPLER_STATUS_BOOT );
459458 ow_resampler_report_state (resampler );
460459
461- booting_start_usecs = current_usecs ;
460+ resampler -> phase_start_usecs = current_usecs ;
462461
463462 return 0 ;
464463 }
@@ -468,7 +467,7 @@ ow_resampler_compute_ratios (struct ow_resampler *resampler,
468467 ow_resampler_set_ratios_from_dll (resampler );
469468
470469 if (status == OW_RESAMPLER_STATUS_BOOT &&
471- current_usecs - booting_start_usecs > BOOTING_PERIOD_US &&
470+ current_usecs - resampler -> phase_start_usecs > BOOTING_PERIOD_US &&
472471 ow_dll_tuned (dll , BOOTING_ERROR ))
473472 {
474473 debug_print (1 , "%s (%s): Tuning resampler..." , resampler -> engine -> name ,
@@ -483,11 +482,11 @@ ow_resampler_compute_ratios (struct ow_resampler *resampler,
483482 resampler -> report_period * resampler -> samplerate / resampler -> bufsize ;
484483 resampler -> log_cycles = 0 ;
485484
486- tuning_start_usecs = current_usecs ;
485+ resampler -> phase_start_usecs = current_usecs ;
487486 }
488487
489488 if (status == OW_RESAMPLER_STATUS_TUNE &&
490- current_usecs - tuning_start_usecs > TUNING_PERIOD_US &&
489+ current_usecs - resampler -> phase_start_usecs > TUNING_PERIOD_US &&
491490 ow_dll_tuned (dll , TUNING_ERROR ))
492491 {
493492 debug_print (1 , "%s (%s): Running resampler..." ,
0 commit comments