mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
split pa_memblockq_flush() into two flush commands, one which fixes up the read ptr, and one which fixes up the write ptr
This commit is contained in:
parent
5fccac94e7
commit
1514d13835
5 changed files with 45 additions and 25 deletions
|
|
@ -638,7 +638,7 @@ void pa_memblockq_seek(pa_memblockq *bq, int64_t offset, pa_seek_mode_t seek) {
|
|||
bq->missing -= delta;
|
||||
}
|
||||
|
||||
void pa_memblockq_flush(pa_memblockq *bq) {
|
||||
void pa_memblockq_flush_write(pa_memblockq *bq) {
|
||||
int64_t old, delta;
|
||||
pa_assert(bq);
|
||||
|
||||
|
|
@ -662,6 +662,21 @@ void pa_memblockq_flush(pa_memblockq *bq) {
|
|||
bq->missing -= delta;
|
||||
}
|
||||
|
||||
void pa_memblockq_flush_read(pa_memblockq *bq) {
|
||||
int64_t old, delta;
|
||||
pa_assert(bq);
|
||||
|
||||
pa_memblockq_silence(bq);
|
||||
|
||||
old = bq->read_index;
|
||||
bq->read_index = bq->write_index;
|
||||
|
||||
pa_memblockq_prebuf_force(bq);
|
||||
|
||||
delta = bq->read_index - old;
|
||||
bq->missing += delta;
|
||||
}
|
||||
|
||||
size_t pa_memblockq_get_tlength(pa_memblockq *bq) {
|
||||
pa_assert(bq);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue