Skip to content

Commit

Permalink
Fix pipeline test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
baranovmv committed May 16, 2024
1 parent 97af7c7 commit 0aa49fb
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/internal_modules/roc_audio/latency_tuner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ LatencyTuner::LatencyTuner(const LatencyConfig& config,
enable_tuning_
? config.start_latency
: config.target_latency);
if (target_latency_ <= 0) {
if (config.tuner_profile != audio::LatencyTunerProfile_Intact
&& target_latency_ <= 0) {
roc_log(LogError,
"latency tuner: invalid config: target latency is invalid:"
" start_latency=%ld(%.3fms), target_latency=%ld(%.3fms)",
Expand All @@ -247,21 +248,6 @@ LatencyTuner::LatencyTuner(const LatencyConfig& config,
return;
}

if (target_latency_ < min_latency_ || target_latency_ > max_latency_) {
roc_log(
LogError,
"latency tuner: invalid config: target_latency is out of bounds:"
" target_latency=%ld(%.3fms)"
" min_latency=%ld(%.3fms) max_latency=%ld(%.3fms)",
(long)sample_spec_.ns_2_stream_timestamp_delta(target_latency_),
(double)config.target_latency / core::Millisecond,
(long)sample_spec_.ns_2_stream_timestamp_delta(config.min_latency),
(double)config.min_latency / core::Millisecond,
(long)sample_spec_.ns_2_stream_timestamp_delta(config.max_latency),
(double)config.max_latency / core::Millisecond);
return;
}

if (enable_bounds_) {
min_latency_ = sample_spec_.ns_2_stream_timestamp_delta(config.min_latency);
max_latency_ = sample_spec_.ns_2_stream_timestamp_delta(config.max_latency);
Expand All @@ -288,6 +274,22 @@ LatencyTuner::LatencyTuner(const LatencyConfig& config,
(long)sample_spec_.ns_2_stream_timestamp_delta(config.max_latency),
(double)config.max_latency / core::Millisecond);
}


if (target_latency_ < min_latency_ || target_latency_ > max_latency_) {
roc_log(
LogError,
"latency tuner: invalid config: target_latency is out of bounds:"
" target_latency=%ld(%.3fms)"
" min_latency=%ld(%.3fms) max_latency=%ld(%.3fms)",
(long)sample_spec_.ns_2_stream_timestamp_delta(target_latency_),
(double)config.target_latency / core::Millisecond,
(long)sample_spec_.ns_2_stream_timestamp_delta(config.min_latency),
(double)config.min_latency / core::Millisecond,
(long)sample_spec_.ns_2_stream_timestamp_delta(config.max_latency),
(double)config.max_latency / core::Millisecond);
return;
}
}

if (enable_tuning_) {
Expand Down

0 comments on commit 0aa49fb

Please sign in to comment.