LibMedia+LibWeb: Disable audio output in headless mode

Audio output on macOS was consuming Core Audio resources until the
PlaybackStream creation took well over the timeout for some tests.
This was observed in media-source-buffered.html, where it would time
out due to the long-running callback on the main thread to create the
PlaybackStream for AudioMixingSink.

However, the AudioUnit init should definitely not be blocking the main
thread, so I've added a FIXME there.
This commit is contained in:
Zaggy1024
2026-04-01 01:54:56 -05:00
committed by Gregory Bertilson
parent 94be6c7611
commit 1467127d35
Notes: github-actions[bot] 2026-04-01 07:55:31 +00:00
4 changed files with 9 additions and 1 deletions

View File

@@ -1751,6 +1751,7 @@ void HTMLMediaElement::on_metadata_parsed()
void HTMLMediaElement::set_up_playback_manager_for_remote()
{
m_playback_manager = Media::PlaybackManager::create();
m_playback_manager->set_audio_output_disabled(document().page().client().is_headless());
m_has_enabled_preferred_audio_track = false;
m_has_selected_preferred_video_track = false;
@@ -1816,6 +1817,7 @@ void HTMLMediaElement::set_up_playback_manager_for_remote()
void HTMLMediaElement::set_up_playback_manager_for_local()
{
m_playback_manager = Media::PlaybackManager::create();
m_playback_manager->set_audio_output_disabled(document().page().client().is_headless());
m_has_enabled_preferred_audio_track = false;
m_has_selected_preferred_video_track = false;