mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
client-stream: improve scheduling
This commit is contained in:
parent
710f0f59cf
commit
e68624fe7b
1 changed files with 11 additions and 8 deletions
|
|
@ -744,7 +744,7 @@ static int impl_node_process(struct spa_node *node)
|
||||||
{
|
{
|
||||||
struct node *this = SPA_CONTAINER_OF(node, struct node, node);
|
struct node *this = SPA_CONTAINER_OF(node, struct node, node);
|
||||||
struct impl *impl = this->impl;
|
struct impl *impl = this->impl;
|
||||||
int status, trigger = 1;
|
int status, trigger;
|
||||||
|
|
||||||
impl->ctrl.min_size = impl->ctrl.max_size =
|
impl->ctrl.min_size = impl->ctrl.max_size =
|
||||||
impl->this.node->driver_node->rt.quantum->size;
|
impl->this.node->driver_node->rt.quantum->size;
|
||||||
|
|
@ -753,11 +753,6 @@ static int impl_node_process(struct spa_node *node)
|
||||||
|
|
||||||
if (impl->use_converter) {
|
if (impl->use_converter) {
|
||||||
status = spa_node_process(impl->adapter);
|
status = spa_node_process(impl->adapter);
|
||||||
|
|
||||||
if (impl->direction == SPA_DIRECTION_OUTPUT)
|
|
||||||
trigger = status & SPA_STATUS_NEED_BUFFER;
|
|
||||||
else
|
|
||||||
trigger = status & SPA_STATUS_HAVE_BUFFER;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
struct spa_io_buffers tmp;
|
struct spa_io_buffers tmp;
|
||||||
|
|
@ -771,10 +766,18 @@ static int impl_node_process(struct spa_node *node)
|
||||||
*impl->io = *impl->client_port_mix.io;
|
*impl->io = *impl->client_port_mix.io;
|
||||||
*impl->client_port_mix.io = tmp;
|
*impl->client_port_mix.io = tmp;
|
||||||
|
|
||||||
status = impl->io->status;
|
status = impl->client_port_mix.io->status | impl->io->status;
|
||||||
}
|
}
|
||||||
spa_log_trace(this->log, "%p: process %d", this, status);
|
spa_log_trace(this->log, "%p: process %d", this, status);
|
||||||
|
|
||||||
|
if (impl->direction == SPA_DIRECTION_OUTPUT) {
|
||||||
|
if (!(status & SPA_STATUS_HAVE_BUFFER))
|
||||||
|
spa_log_warn(this->log, "%p: process underrun", this);
|
||||||
|
trigger = status & SPA_STATUS_NEED_BUFFER;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
trigger = status & SPA_STATUS_HAVE_BUFFER;
|
||||||
|
|
||||||
if (trigger)
|
if (trigger)
|
||||||
spa_graph_run(impl->client_node->node->rt.root.graph);
|
spa_graph_run(impl->client_node->node->rt.root.graph);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue