Created attachment 60256 [details]
C source demonstrating bug
As reported on the mailing list:
The documentation for pa_stream_flush() reads, "This discards any audio in the buffer." To me, this implies that pa_stream_readable_size() should return 0 after a call to pa_stream_flush(). Tanu Kaskinen on the mailing list agrees, and asked me to report it here.
Attached is a program to demonstrate this failure. On my machine with PulseAudio 1.1:
$ gcc -pthread -lpulse -o test pulse_capture_flush.c
pulse is ready now!
stream is ready now!
pre-sleep avail: 0 bytes
post-cork avail: 349360 bytes
post-flush avail: 349360 bytes
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/284.