mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
examples: exit early when no longer running
When we are no longer running after the eventfd was signaled, stop producing samples.
This commit is contained in:
parent
fecf1bcba4
commit
50fe63ea76
1 changed files with 2 additions and 0 deletions
|
|
@ -89,6 +89,8 @@ static void push_samples(void *userdata, float *samples, uint32_t n_samples)
|
||||||
|
|
||||||
/* no space.. block and wait for free space */
|
/* no space.. block and wait for free space */
|
||||||
spa_system_eventfd_read(data->loop->system, data->eventfd, &count);
|
spa_system_eventfd_read(data->loop->system, data->eventfd, &count);
|
||||||
|
if (!data->running)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (avail > n_samples)
|
if (avail > n_samples)
|
||||||
avail = n_samples;
|
avail = n_samples;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue