mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
adapter: use the right default when filtering default
We should prefer the value of the follower when fixating to the PortConfig format. To make this actually work we need to be able to check if the value is within the configured ranges. Implement the check for all types by simply comparing the memory. This should then work also for checking arrays, such as channel positions.
This commit is contained in:
parent
a5e63102d9
commit
38a3ebdca1
3 changed files with 3 additions and 5 deletions
|
|
@ -52,8 +52,6 @@ SPA_API_POD_COMPARE int spa_pod_compare_value(uint32_t type, const void *r1, con
|
|||
return SPA_CMP(*(double *)r1, *(double *)r2);
|
||||
case SPA_TYPE_String:
|
||||
return strcmp((char *)r1, (char *)r2);
|
||||
case SPA_TYPE_Bytes:
|
||||
return memcmp((char *)r1, (char *)r2, size);
|
||||
case SPA_TYPE_Rectangle:
|
||||
{
|
||||
const struct spa_rectangle *rec1 = (struct spa_rectangle *) r1,
|
||||
|
|
@ -75,7 +73,7 @@ SPA_API_POD_COMPARE int spa_pod_compare_value(uint32_t type, const void *r1, con
|
|||
return SPA_CMP(n1, n2);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
return memcmp(r1, r2, size);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -927,7 +927,7 @@ static struct spa_pod *merge_objects(struct impl *this, struct spa_pod_builder *
|
|||
p2 = spa_pod_object_find_prop(o2, p2, p1->key);
|
||||
if (p2 != NULL) {
|
||||
spa_pod_builder_get_state(b, &state);
|
||||
res = spa_pod_filter_prop(b, p1, p2);
|
||||
res = spa_pod_filter_prop(b, p2, p1);
|
||||
if (res < 0)
|
||||
spa_pod_builder_reset(b, &state);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -978,7 +978,7 @@ static struct spa_pod *merge_objects(struct impl *this, struct spa_pod_builder *
|
|||
p2 = spa_pod_object_find_prop(o2, p2, p1->key);
|
||||
if (p2 != NULL) {
|
||||
spa_pod_builder_get_state(b, &state);
|
||||
res = spa_pod_filter_prop(b, p1, p2);
|
||||
res = spa_pod_filter_prop(b, p2, p1);
|
||||
if (res < 0)
|
||||
spa_pod_builder_reset(b, &state);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue