mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
audioadapter: avoid infinite loop
Rewrite the slave/converter loop a little to avoid infinite loops.
This commit is contained in:
parent
147f488514
commit
24ab22db12
1 changed files with 10 additions and 5 deletions
|
|
@ -875,16 +875,21 @@ static int impl_node_process(void *object)
|
||||||
status = spa_node_process(this->convert);
|
status = spa_node_process(this->convert);
|
||||||
}
|
}
|
||||||
|
|
||||||
again:
|
|
||||||
status = spa_node_process(this->slave);
|
status = spa_node_process(this->slave);
|
||||||
|
|
||||||
if (this->direction == SPA_DIRECTION_OUTPUT &&
|
if (this->direction == SPA_DIRECTION_OUTPUT &&
|
||||||
!this->master && this->use_converter) {
|
!this->master && this->use_converter) {
|
||||||
|
while (true) {
|
||||||
status = spa_node_process(this->convert);
|
status = spa_node_process(this->convert);
|
||||||
|
if (status & SPA_STATUS_HAVE_DATA)
|
||||||
|
break;
|
||||||
|
|
||||||
if (!(status & SPA_STATUS_HAVE_DATA) &&
|
if (status & SPA_STATUS_NEED_DATA) {
|
||||||
(status & SPA_STATUS_NEED_DATA))
|
status = spa_node_process(this->slave);
|
||||||
goto again;
|
if (!(status & SPA_STATUS_HAVE_DATA))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
spa_log_trace_fp(this->log, "%p: process status:%d", this, status);
|
spa_log_trace_fp(this->log, "%p: process status:%d", this, status);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue