diff --git a/src/display_device.cpp b/src/display_device.cpp index 2ea9c6789eb..a9a21b6ad1b 100644 --- a/src/display_device.cpp +++ b/src/display_device.cpp @@ -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; } }