From bdb604cc459f22bb3eb1b8ee3d3f987ea5a0a74b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 4 Aug 2015 22:19:42 -0700 Subject: [PATCH] PulseAudio: handle error instead of panicking --- src/pulseaudio.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pulseaudio.cpp b/src/pulseaudio.cpp index 25dea91..34601e3 100644 --- a/src/pulseaudio.cpp +++ b/src/pulseaudio.cpp @@ -975,9 +975,8 @@ static int instream_begin_read_pa(SoundIoPrivate *si, assert(ispa->stream_ready); if (!ispa->peek_buf) { - if (pa_stream_peek(stream, (const void **)&ispa->peek_buf, &ispa->peek_buf_size)) { - soundio_panic("TODO"); - } + if (pa_stream_peek(stream, (const void **)&ispa->peek_buf, &ispa->peek_buf_size)) + return SoundIoErrorStreaming; ispa->peek_buf_frames_left = ispa->peek_buf_size / instream->bytes_per_frame; ispa->peek_buf_index = 0;