mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pw-cat: don't start drain on 0 request size
When the stream requests a 0 size buffer, don't start the drain but simply queue a 0 size buffer. Sometimes, switching quantums and drivers might request a 0 buffer async and this should not cause a drain operation.
This commit is contained in:
parent
96286fb8b1
commit
32b2377de3
1 changed files with 4 additions and 1 deletions
|
|
@ -745,7 +745,7 @@ static void on_process(void *userdata)
|
|||
|
||||
n_fill_frames = data->fill(data, p, n_frames);
|
||||
|
||||
if (n_fill_frames > 0) {
|
||||
if (n_fill_frames > 0 || n_frames == 0) {
|
||||
d->chunk->offset = 0;
|
||||
d->chunk->stride = data->stride;
|
||||
d->chunk->size = n_fill_frames * data->stride;
|
||||
|
|
@ -753,6 +753,9 @@ static void on_process(void *userdata)
|
|||
b->size = n_frames;
|
||||
} else if (n_fill_frames < 0) {
|
||||
fprintf(stderr, "fill error %d\n", n_fill_frames);
|
||||
} else {
|
||||
if (data->verbose)
|
||||
printf("drain start\n");
|
||||
}
|
||||
} else {
|
||||
offset = SPA_MIN(d->chunk->offset, d->maxsize);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue