mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: always use rate_match value when available
The minreq is just a fallback for when we don't know the exact amount of required samples to consume from the ringbuffer.
This commit is contained in:
parent
02295c5e2b
commit
bf25fc1388
1 changed files with 3 additions and 2 deletions
|
|
@ -1444,9 +1444,10 @@ static void stream_process(void *data)
|
|||
|
||||
if (stream->direction == PW_DIRECTION_OUTPUT) {
|
||||
int32_t avail = spa_ringbuffer_get_read_index(&stream->ring, &pd.read_index);
|
||||
minreq = SPA_MAX(stream->minblock, stream->attr.minreq);
|
||||
if (stream->rate_match)
|
||||
minreq = SPA_MIN(minreq, stream->rate_match->size * stream->frame_size);
|
||||
minreq = stream->rate_match->size * stream->frame_size;
|
||||
else
|
||||
minreq = SPA_MAX(stream->minblock, stream->attr.minreq);
|
||||
if (avail <= 0) {
|
||||
/* underrun, produce a silence buffer */
|
||||
size = SPA_MIN(buf->datas[0].maxsize, minreq);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue