summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2017-11-24 16:45:54 +0100
committerWim Taymans <wtaymans@redhat.com>2017-11-24 16:48:13 +0100
commite2c49199f65123da29d120eb27bd1731e3b508aa (patch)
tree6434bd1e7be16a4925f0b57e8cf1d8c1367d389f
parent263a017c4bc685eafc966692d931ddd53d5de6ab (diff)
link: fix param enumeration
When the input port param enumeration has no result, use the NULL filter to still enumerate the output port parameters instead of returning nothing. Fix the offset in the gst element.
-rw-r--r--src/gst/gstpipewiresrc.c1
-rw-r--r--src/pipewire/link.c15
2 files changed, 13 insertions, 3 deletions
diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c
index f65878b6..16f74848 100644
--- a/src/gst/gstpipewiresrc.c
+++ b/src/gst/gstpipewiresrc.c
@@ -467,6 +467,7 @@ on_new_buffer (void *_data,
GstMemory *mem = gst_buffer_peek_memory (buf, i);
mem->offset = SPA_MIN(d->chunk->offset, d->maxsize);
mem->size = SPA_MIN(d->chunk->size, d->maxsize - mem->offset);
+ mem->offset += data->offset;
}
if (pwsrc->always_copy)
diff --git a/src/pipewire/link.c b/src/pipewire/link.c
index 1f7b7802..0843089a 100644
--- a/src/pipewire/link.c
+++ b/src/pipewire/link.c
@@ -464,15 +464,22 @@ param_filter(struct pw_link *this,
struct spa_pod_builder ib = { 0 };
struct spa_pod *oparam, *iparam;
uint32_t iidx, oidx, num = 0;
+ int res;
for (iidx = 0;;) {
spa_pod_builder_init(&ib, ibuf, sizeof(ibuf));
pw_log_debug("iparam %d", iidx);
- if (spa_node_port_enum_params(in_port->node->node, in_port->direction, in_port->port_id,
- id, &iidx, NULL, &iparam, &ib) <= 0)
+ if ((res = spa_node_port_enum_params(in_port->node->node,
+ in_port->direction, in_port->port_id,
+ id, &iidx, NULL, &iparam, &ib)) < 0)
break;
- if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
+ if (res == 0 && num > 0)
+ break;
+ else
+ iparam = NULL;
+
+ if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG) && iparam != NULL)
spa_debug_pod(iparam, 0);
for (oidx = 0;;) {
@@ -488,6 +495,8 @@ param_filter(struct pw_link *this,
num++;
}
+ if (iparam == NULL && num == 0)
+ break;
}
return num;
}