mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pulse-server: update the in_prebuf state
Move out of prebuf when we reach the prebuf amount of data. Go back to prebuf when we run empty.
This commit is contained in:
parent
d3e74a49e7
commit
c468dbebbb
1 changed files with 8 additions and 4 deletions
|
|
@ -114,10 +114,14 @@ static bool stream_prebuf_active(struct stream *stream)
|
|||
|
||||
avail = spa_ringbuffer_get_write_index(&stream->ring, &index);
|
||||
|
||||
if (stream->in_prebuf)
|
||||
return avail < (int32_t) stream->attr.prebuf;
|
||||
else
|
||||
return stream->attr.prebuf > 0 && avail <= 0;
|
||||
if (stream->in_prebuf) {
|
||||
if (avail >= (int32_t) stream->attr.prebuf)
|
||||
stream->in_prebuf = false;
|
||||
} else {
|
||||
if (stream->attr.prebuf > 0 && avail <= 0)
|
||||
stream->in_prebuf = true;
|
||||
}
|
||||
return stream->in_prebuf;
|
||||
}
|
||||
|
||||
uint32_t stream_pop_missing(struct stream *stream)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue