mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
module-ffado: fix latency configuration
Don't deref the port before we created it.
This commit is contained in:
parent
cc82715325
commit
7de7a620f3
1 changed files with 8 additions and 7 deletions
|
|
@ -425,6 +425,7 @@ static void make_stream_ports(struct stream *s)
|
||||||
char name[512];
|
char name[512];
|
||||||
uint8_t buffer[1024];
|
uint8_t buffer[1024];
|
||||||
struct spa_pod_builder b;
|
struct spa_pod_builder b;
|
||||||
|
struct spa_latency_info latency;
|
||||||
const struct spa_pod *params[2];
|
const struct spa_pod *params[2];
|
||||||
uint32_t i, n_params = 0;
|
uint32_t i, n_params = 0;
|
||||||
bool is_midi;
|
bool is_midi;
|
||||||
|
|
@ -474,16 +475,15 @@ static void make_stream_ports(struct stream *s)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
spa_zero(port->latency[s->direction]);
|
latency = SPA_LATENCY_INFO(s->direction,
|
||||||
port->latency[s->direction].min_quantum =
|
.min_quantum = 1,
|
||||||
port->latency[s->direction].max_quantum = 1;
|
.max_quantum = 1,
|
||||||
port->latency[s->direction].min_rate =
|
.min_rate = impl->latency[s->direction],
|
||||||
port->latency[s->direction].max_rate = impl->latency[s->direction];
|
.max_rate = impl->latency[s->direction]);
|
||||||
|
|
||||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
n_params = 0;
|
n_params = 0;
|
||||||
params[n_params++] = spa_latency_build(&b,
|
params[n_params++] = spa_latency_build(&b, SPA_PARAM_Latency, &latency);
|
||||||
SPA_PARAM_Latency, &port->latency[s->direction]);
|
|
||||||
|
|
||||||
port = pw_filter_add_port(s->filter,
|
port = pw_filter_add_port(s->filter,
|
||||||
s->direction,
|
s->direction,
|
||||||
|
|
@ -495,6 +495,7 @@ static void make_stream_ports(struct stream *s)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
port->latency[s->direction] = latency;
|
||||||
port->is_midi = is_midi;
|
port->is_midi = is_midi;
|
||||||
port->buffer = calloc(sizeof(float), impl->quantum_limit);
|
port->buffer = calloc(sizeof(float), impl->quantum_limit);
|
||||||
if (port->buffer == NULL) {
|
if (port->buffer == NULL) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue