aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/backends/pulseaudio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c
index f7fc86ba..8fe1118b 100644
--- a/Alc/backends/pulseaudio.c
+++ b/Alc/backends/pulseaudio.c
@@ -1332,7 +1332,12 @@ static ALCuint pulse_available_samples(ALCdevice *device)
if(device->Connected)
{
ssize_t got = pa_stream_readable_size(data->stream);
- if(got > 0 && (size_t)got > data->cap_len)
+ if(got < 0)
+ {
+ ERR("pa_stream_readable_size() failed: %s\n", pa_strerror(got));
+ aluHandleDisconnect(device);
+ }
+ else if((size_t)got > data->cap_len)
readable += got - data->cap_len;
}
pa_threaded_mainloop_unlock(data->loop);