Skip to content

Commit

Permalink
sonar cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogTheFrog committed Dec 11, 2024
1 parent cd91683 commit fad840c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/display_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ namespace display_device {
audio_context->released = true;

const auto *audio_ctx_ptr = audio_context->audio_ctx_ref.get();
if (audio_ctx_ptr) {
if (audio_ctx_ptr && !audio::is_audio_ctx_sink_available(*audio_ctx_ptr) && audio_context->retry_counter > 0) {
// It is possible that the audio sink is not immediately available after the display is turned on.
// Therefore, we will hold on to the audio context a little longer, until it is either available
// or we time out.
if (!audio::is_audio_ctx_sink_available(*audio_ctx_ptr) && audio_context->retry_counter > 0) {
--audio_context->retry_counter;
return;
}
--audio_context->retry_counter;
return;
}
}

Expand Down

0 comments on commit fad840c

Please sign in to comment.