diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 5d205fb..ee288e8 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -493,6 +493,14 @@ static void read_callback(pa_stream *s, size_t length, void *userdata) { return; } + if (!data) { + /* NULL data means either a hole or empty buffer. + * Only drop the stream when there is a hole (length > 0) */ + if (length) + pa_stream_drop(s); + return; + } + assert(length > 0); assert(length % sizeof(float) == 0);