diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-04-12 10:06:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 10:06:07 +0200 |
commit | 12a9495f5e0754f4eab36556c77ec1d90232b26e (patch) | |
tree | b11b67b2fb852b2624731f31984452ac2aeed4a6 | |
parent | 5324bbb77227f80d43604c8e104419f2700d8796 (diff) | |
parent | 86e101ec823e916080cb113031ff04edbe3757c6 (diff) |
Merge pull request #18123 from marcelofg55/pulse_stream_error
Fix error detecting for PulseAudio pa_stream_new call
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 5dddb1a900..617414d2c5 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -177,7 +177,10 @@ Error AudioDriverPulseAudio::init_device() { attr.minreq = (uint32_t)-1; pa_str = pa_stream_new(pa_ctx, "Sound", &spec, NULL); - ERR_FAIL_COND_V(pa_ctx == NULL, ERR_CANT_OPEN); + if (pa_str == NULL) { + ERR_PRINTS("PulseAudio: pa_stream_new error: " + String(pa_strerror(pa_context_errno(pa_ctx)))); + ERR_FAIL_V(ERR_CANT_OPEN); + } const char *dev = device_name == "Default" ? NULL : device_name.utf8().get_data(); pa_stream_flags flags = pa_stream_flags(PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_ADJUST_LATENCY | PA_STREAM_AUTO_TIMING_UPDATE); |