[pulseaudio-discuss] Emptying a record stream's buffer
Andrew Eikum
aeikum at codeweavers.com
Tue Apr 17 12:32:41 PDT 2012
On Tue, Apr 17, 2012 at 10:24:50PM +0300, Tanu Kaskinen wrote:
> On Tue, 2012-04-17 at 14:15 -0500, Andrew Eikum wrote:
> > On Tue, Apr 17, 2012 at 09:58:05PM +0300, Tanu Kaskinen wrote:
> > > May I ask what you're trying to achieve? It's not immediately obvious to
> > > me how pa_stream_flush() could be useful for record streams at all.
> > >
> >
> > I'm working on a PulseAudio driver for Wine. One of the functions the
> > driver needs to perform is a "Reset" which dumps all of the data
> > sitting in the record buffer and resets the readable size to 0. I was
> > hoping to use pa_stream_readable_size() in order to tell how much data
> > is in the buffer ready to be read, but that seems incompatible with
> > the requirement of dumping the data on Reset.
>
> By "dumping", do you mean discarding the data? If so, wouldn't it work
> if you would call pa_stream_read() on "Reset" and just throw away that
> data? That way the client-side buffer would be emptied. You could call
> pa_stream_flush() prior to that, if you think flushing also the
> server-side data is in some way useful.
>
Yep, that would probably work :) The documentation implied that flush
would do what I wanted in a single function call, so I tried that
instead. Then I reported here when it behaved differently from how I
expected it to.
PS: Client-side buffer? Server-side data? Should I know or care about
that as an application developer? Is there an explanation someplace
about how that might affect my application?
Thanks again,
Andrew
More information about the pulseaudio-discuss
mailing list