diff --git a/spa/plugins/filter-graph/audio-plugin.h b/spa/plugins/filter-graph/audio-plugin.h index d8925ea33..81d55294c 100644 --- a/spa/plugins/filter-graph/audio-plugin.h +++ b/spa/plugins/filter-graph/audio-plugin.h @@ -27,10 +27,11 @@ struct spa_fga_plugin_methods { struct spa_fga_port { uint32_t index; const char *name; -#define SPA_FGA_PORT_INPUT (1ULL << 0) -#define SPA_FGA_PORT_OUTPUT (1ULL << 1) -#define SPA_FGA_PORT_CONTROL (1ULL << 2) -#define SPA_FGA_PORT_AUDIO (1ULL << 3) +#define SPA_FGA_PORT_INPUT (1ULL << 0) +#define SPA_FGA_PORT_OUTPUT (1ULL << 1) +#define SPA_FGA_PORT_CONTROL (1ULL << 2) +#define SPA_FGA_PORT_AUDIO (1ULL << 3) +#define SPA_FGA_PORT_SUPPORTS_NULL_DATA (1ULL << 4) uint64_t flags; #define SPA_FGA_HINT_BOOLEAN (1ULL << 0) @@ -47,6 +48,7 @@ struct spa_fga_port { #define SPA_FGA_IS_PORT_OUTPUT(x) ((x) & SPA_FGA_PORT_OUTPUT) #define SPA_FGA_IS_PORT_CONTROL(x) ((x) & SPA_FGA_PORT_CONTROL) #define SPA_FGA_IS_PORT_AUDIO(x) ((x) & SPA_FGA_PORT_AUDIO) +#define SPA_FGA_SUPPORTS_NULL_DATA(x) ((x) & SPA_FGA_PORT_SUPPORTS_NULL_DATA) struct spa_fga_descriptor { const char *name; diff --git a/spa/plugins/filter-graph/filter-graph.c b/spa/plugins/filter-graph/filter-graph.c index c9d276c5f..718bc542d 100644 --- a/spa/plugins/filter-graph/filter-graph.c +++ b/spa/plugins/filter-graph/filter-graph.c @@ -1619,6 +1619,8 @@ static int impl_activate(void *object, const struct spa_dict *props) if ((res = port_ensure_data(link->output, i, max_samples)) < 0) goto error; data = link->output->audio_data[i]; + } else if (SPA_FGA_SUPPORTS_NULL_DATA(d->ports[port->p].flags)) { + data = NULL; } else { data = sd; } @@ -1629,9 +1631,13 @@ static int impl_activate(void *object, const struct spa_dict *props) for (j = 0; j < desc->n_output; j++) { port = &node->output_port[j]; if (port->audio_data[i] == NULL) { + if (SPA_FGA_SUPPORTS_NULL_DATA(d->ports[port->p].flags)) + data = NULL; + else + data = dd; spa_log_info(impl->log, "connect output port %s[%d]:%s %p", - node->name, i, d->ports[port->p].name, dd); - d->connect_port(node->hndl[i], port->p, dd); + node->name, i, d->ports[port->p].name, data); + d->connect_port(node->hndl[i], port->p, data); } } for (j = 0; j < desc->n_control; j++) {