summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2017-11-14 16:49:07 +0100
committerWim Taymans <wtaymans@redhat.com>2017-11-14 16:49:07 +0100
commit49d8f6792e133df08ee32c76d69a89a1d170c0b2 (patch)
tree5885dca1db6f28e3a40d91acf39c8dfa2d93349a
parent0534571f7dcf7610806d8b294cc74250e5ef35d5 (diff)
pod: first compare, then advance to next item
-rw-r--r--spa/lib/pod.c11
-rw-r--r--src/pipewire/link.c2
2 files changed, 7 insertions, 6 deletions
diff --git a/spa/lib/pod.c b/spa/lib/pod.c
index 22de1d50..a9acef8d 100644
--- a/spa/lib/pod.c
+++ b/spa/lib/pod.c
@@ -367,7 +367,6 @@ int pod_filter(struct spa_pod_builder *b,
if (!spa_pod_is_inside(filter, filter_size, pf))
pf = NULL;
}
-
if (res < 0)
break;
}
@@ -462,17 +461,17 @@ int pod_compare(const struct spa_pod *pod1, uint32_t pod1_size,
do_advance = true;
break;
}
- if (do_advance) {
- p2 = spa_pod_next(p2);
- if (!spa_pod_is_inside(pod2, pod2_size, p2))
- p2 = NULL;
- }
if (recurse_offset) {
res = pod_compare(SPA_MEMBER(p1,recurse_offset,void),
SPA_POD_SIZE(p1) - recurse_offset,
SPA_MEMBER(p2,recurse_offset,void),
SPA_POD_SIZE(p2) - recurse_offset);
}
+ if (do_advance) {
+ p2 = spa_pod_next(p2);
+ if (!spa_pod_is_inside(pod2, pod2_size, p2))
+ p2 = NULL;
+ }
if (res != 0)
return res;
}
diff --git a/src/pipewire/link.c b/src/pipewire/link.c
index 183f47bc..cdf87dba 100644
--- a/src/pipewire/link.c
+++ b/src/pipewire/link.c
@@ -155,6 +155,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
out_state = PW_PORT_STATE_CONFIGURE;
}
else {
+ pw_log_debug("link %p: format was already set", this);
pw_node_update_state(output->node, PW_NODE_STATE_RUNNING, NULL);
changed = false;
}
@@ -175,6 +176,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
in_state = PW_PORT_STATE_CONFIGURE;
}
else {
+ pw_log_debug("link %p: format was already set", this);
pw_node_update_state(input->node, PW_NODE_STATE_RUNNING, NULL);
changed = false;
}