mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
filter-chain: support NULL data for the delay filter
This commit is contained in:
parent
cd82c7259b
commit
d83bf90a3a
1 changed files with 4 additions and 0 deletions
|
|
@ -1181,6 +1181,9 @@ static void delay_run(void * Instance, unsigned long SampleCount)
|
||||||
float *in = impl->port[1], *out = impl->port[0];
|
float *in = impl->port[1], *out = impl->port[0];
|
||||||
float delay = impl->port[2][0];
|
float delay = impl->port[2][0];
|
||||||
|
|
||||||
|
if (in == NULL || out == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (delay != impl->delay) {
|
if (delay != impl->delay) {
|
||||||
impl->delay_samples = SPA_CLAMP((uint32_t)(delay * impl->rate), 0u, impl->buffer_samples-1);
|
impl->delay_samples = SPA_CLAMP((uint32_t)(delay * impl->rate), 0u, impl->buffer_samples-1);
|
||||||
impl->delay = delay;
|
impl->delay = delay;
|
||||||
|
|
@ -1207,6 +1210,7 @@ static struct fc_port delay_ports[] = {
|
||||||
|
|
||||||
static const struct fc_descriptor delay_desc = {
|
static const struct fc_descriptor delay_desc = {
|
||||||
.name = "delay",
|
.name = "delay",
|
||||||
|
.flags = FC_DESCRIPTOR_SUPPORTS_NULL_DATA,
|
||||||
|
|
||||||
.n_ports = 3,
|
.n_ports = 3,
|
||||||
.ports = delay_ports,
|
.ports = delay_ports,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue