mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
filter: return better value from process()
This commit is contained in:
parent
0ab335d041
commit
606bbefaa4
1 changed files with 8 additions and 2 deletions
|
|
@ -1000,6 +1000,7 @@ static int impl_node_process(void *object)
|
||||||
struct port *p;
|
struct port *p;
|
||||||
struct buffer *b;
|
struct buffer *b;
|
||||||
bool drained = true;
|
bool drained = true;
|
||||||
|
int res = 0;
|
||||||
|
|
||||||
pw_log_trace_fp("%p: do process %p", impl, impl->rt.position);
|
pw_log_trace_fp("%p: do process %p", impl, impl->rt.position);
|
||||||
|
|
||||||
|
|
@ -1041,6 +1042,7 @@ static int impl_node_process(void *object)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (p->direction == SPA_DIRECTION_INPUT) {
|
if (p->direction == SPA_DIRECTION_INPUT) {
|
||||||
|
res |= SPA_STATUS_NEED_DATA;
|
||||||
if (SPA_UNLIKELY(io->status != SPA_STATUS_HAVE_DATA))
|
if (SPA_UNLIKELY(io->status != SPA_STATUS_HAVE_DATA))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -1053,17 +1055,21 @@ static int impl_node_process(void *object)
|
||||||
}
|
}
|
||||||
io->status = SPA_STATUS_NEED_DATA;
|
io->status = SPA_STATUS_NEED_DATA;
|
||||||
} else {
|
} else {
|
||||||
if (SPA_UNLIKELY(io->status == SPA_STATUS_HAVE_DATA))
|
if (SPA_UNLIKELY(io->status == SPA_STATUS_HAVE_DATA)) {
|
||||||
|
res |= SPA_STATUS_HAVE_DATA;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ((b = pop_queue(p, &p->queued)) != NULL) {
|
if ((b = pop_queue(p, &p->queued)) != NULL) {
|
||||||
pw_log_trace_fp("%p: pop %d %p", impl, b->id, io);
|
pw_log_trace_fp("%p: pop %d %p", impl, b->id, io);
|
||||||
io->buffer_id = b->id;
|
io->buffer_id = b->id;
|
||||||
io->status = SPA_STATUS_HAVE_DATA;
|
io->status = SPA_STATUS_HAVE_DATA;
|
||||||
|
res |= SPA_STATUS_HAVE_DATA;
|
||||||
drained = false;
|
drained = false;
|
||||||
} else {
|
} else {
|
||||||
io->buffer_id = SPA_ID_INVALID;
|
io->buffer_id = SPA_ID_INVALID;
|
||||||
io->status = SPA_STATUS_NEED_DATA;
|
io->status = SPA_STATUS_NEED_DATA;
|
||||||
|
res |= SPA_STATUS_NEED_DATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1071,7 +1077,7 @@ static int impl_node_process(void *object)
|
||||||
if (SPA_UNLIKELY(drained && impl->draining))
|
if (SPA_UNLIKELY(drained && impl->draining))
|
||||||
call_drained(impl);
|
call_drained(impl);
|
||||||
|
|
||||||
return SPA_STATUS_NEED_DATA | SPA_STATUS_HAVE_DATA;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct spa_node_methods impl_node = {
|
static const struct spa_node_methods impl_node = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue