mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
alsa: pause/resume when entering/exiting freewheel
When we start freewheeling, pause the device and resume when we finish freewheel. In freewheel mode, just discard samples in the sink and produce silence in the source.
This commit is contained in:
parent
a80ec36ad5
commit
02decd9fba
4 changed files with 62 additions and 16 deletions
|
|
@ -666,16 +666,13 @@ static int impl_node_process(void *object)
|
|||
spa_alsa_recycle_buffer(this, io->buffer_id);
|
||||
io->buffer_id = SPA_ID_INVALID;
|
||||
}
|
||||
if (this->position && this->position->clock.flags & SPA_IO_CLOCK_FLAG_FREEWHEEL) {
|
||||
spa_log_info(this->log, NAME " %p:freewheel", this);
|
||||
io->status = SPA_STATUS_HAVE_DATA;
|
||||
io->buffer_id = 0;
|
||||
return SPA_STATUS_HAVE_DATA;
|
||||
|
||||
if (spa_list_is_empty(&this->ready) && this->following) {
|
||||
if (this->freewheel)
|
||||
spa_alsa_skip(this);
|
||||
else
|
||||
spa_alsa_read(this);
|
||||
}
|
||||
|
||||
if (spa_list_is_empty(&this->ready) && this->following)
|
||||
spa_alsa_read(this, 0);
|
||||
|
||||
if (spa_list_is_empty(&this->ready) || !this->following)
|
||||
return SPA_STATUS_OK;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue