mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
This allows us to avoid returning a PlaybackStream in cases where the async initialization fails. This is a step towards more graceful fallbacks when audio fails in AudioMixingSink.
23 lines
634 B
C++
23 lines
634 B
C++
/*
|
|
* Copyright (c) 2023-2025, Gregory Bertilson <gregory@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "PlaybackStream.h"
|
|
|
|
namespace Audio {
|
|
|
|
#if !defined(AK_OS_WINDOWS)
|
|
NonnullRefPtr<PlaybackStream::CreatePromise> __attribute__((weak)) PlaybackStream::create(OutputState, u32, AudioDataRequestCallback&&)
|
|
#else
|
|
NonnullRefPtr<PlaybackStream::CreatePromise> PlaybackStream::create(OutputState, u32, AudioDataRequestCallback&&)
|
|
#endif
|
|
{
|
|
auto promise = CreatePromise::construct();
|
|
promise->reject(Error::from_string_literal("Audio output is not available for this platform"));
|
|
return promise;
|
|
}
|
|
|
|
}
|