mirror of
https://github.com/RGBCube/serenity
synced 2025-05-26 03:55:08 +00:00
LibAudio: Improve PulseAudio stream connection error messages
We were missing a formatted error message printout when the connection failed after the initial `pa_stream_connect_playback()` API call.
This commit is contained in:
parent
5ea5ae85d2
commit
c3ded6d56c
1 changed files with 2 additions and 1 deletions
|
@ -230,7 +230,7 @@ ErrorOr<NonnullRefPtr<PulseAudioStream>> PulseAudioContext::create_stream(Output
|
||||||
stream_wrapper.ptr());
|
stream_wrapper.ptr());
|
||||||
|
|
||||||
if (auto error = pa_stream_connect_playback(stream, nullptr, &buffer_attributes, flags, nullptr, nullptr); error != 0) {
|
if (auto error = pa_stream_connect_playback(stream, nullptr, &buffer_attributes, flags, nullptr, nullptr); error != 0) {
|
||||||
warnln("PulseAudio stream connection failed with error: {}", pulse_audio_error_to_string(static_cast<PulseAudioErrorCode>(error)));
|
warnln("Failed to start PulseAudio stream connection with error: {}", pulse_audio_error_to_string(static_cast<PulseAudioErrorCode>(error)));
|
||||||
return Error::from_string_literal("Error while connecting the PulseAudio stream");
|
return Error::from_string_literal("Error while connecting the PulseAudio stream");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,6 +244,7 @@ ErrorOr<NonnullRefPtr<PulseAudioStream>> PulseAudioContext::create_stream(Output
|
||||||
is_ready = true;
|
is_ready = true;
|
||||||
break;
|
break;
|
||||||
case PulseAudioStreamState::Failed:
|
case PulseAudioStreamState::Failed:
|
||||||
|
warnln("PulseAudio stream connection failed with error: {}", pulse_audio_error_to_string(get_last_error()));
|
||||||
return Error::from_string_literal("Failed to connect to PulseAudio daemon");
|
return Error::from_string_literal("Failed to connect to PulseAudio daemon");
|
||||||
case PulseAudioStreamState::Unconnected:
|
case PulseAudioStreamState::Unconnected:
|
||||||
case PulseAudioStreamState::Terminated:
|
case PulseAudioStreamState::Terminated:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue