Emptying a record stream's buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux