mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-05 01:10:24 +00:00
LibMedia: Rename PulseAudioContext::instance() to the()
This commit is contained in:
committed by
Gregory Bertilson
parent
c0939725a2
commit
b8bc129a3c
Notes:
github-actions[bot]
2025-11-24 21:11:04 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b8bc129a3c0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6684
@@ -37,7 +37,7 @@ ErrorOr<NonnullRefPtr<PlaybackStream>> PlaybackStreamPulseAudio::create(OutputSt
|
||||
|
||||
// Create the control thread and start it.
|
||||
auto thread = TRY(Threading::Thread::try_create([=, data_request_callback = move(data_request_callback)]() mutable {
|
||||
auto context = TRY_OR_EXIT_THREAD(PulseAudioContext::instance());
|
||||
auto context = TRY_OR_EXIT_THREAD(PulseAudioContext::the());
|
||||
internal_state->set_stream(TRY_OR_EXIT_THREAD(context->create_stream(initial_state, sample_rate, channels, target_latency_ms, [data_request_callback = move(data_request_callback)](PulseAudioStream&, Bytes buffer, size_t sample_count) {
|
||||
return data_request_callback(buffer, PcmSampleFormat::Float32, sample_count);
|
||||
})));
|
||||
|
||||
@@ -18,7 +18,7 @@ WeakPtr<PulseAudioContext> PulseAudioContext::weak_instance()
|
||||
return the_instance;
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<PulseAudioContext>> PulseAudioContext::instance()
|
||||
ErrorOr<NonnullRefPtr<PulseAudioContext>> PulseAudioContext::the()
|
||||
{
|
||||
static Threading::Mutex instantiation_mutex;
|
||||
// Lock and unlock the mutex to ensure that the mutex is fully unlocked at application
|
||||
|
||||
@@ -40,7 +40,7 @@ class MEDIA_API PulseAudioContext
|
||||
, public Weakable<PulseAudioContext> {
|
||||
public:
|
||||
static AK::WeakPtr<PulseAudioContext> weak_instance();
|
||||
static ErrorOr<NonnullRefPtr<PulseAudioContext>> instance();
|
||||
static ErrorOr<NonnullRefPtr<PulseAudioContext>> the();
|
||||
|
||||
explicit PulseAudioContext(pa_threaded_mainloop*, pa_mainloop_api*, pa_context*);
|
||||
PulseAudioContext(PulseAudioContext const& other) = delete;
|
||||
|
||||
Reference in New Issue
Block a user