diff options
author | Chris Robinson <[email protected]> | 2012-03-05 00:11:28 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-03-05 00:11:28 -0800 |
commit | bc1bb7f90fe44bbfa3c4e7f3a3bc1facfc5cabcd (patch) | |
tree | f194573d3327648638d21d8963d96451e3c960b0 /Alc/backends/pulseaudio.c | |
parent | 0f0141b9dddfc97b4dbb8ba394fc5d26bb8e2b1a (diff) |
Print and handle errors from pa_stream_readable_size
Diffstat (limited to 'Alc/backends/pulseaudio.c')
-rw-r--r-- | Alc/backends/pulseaudio.c | 7 |
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); |