mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
control: only convert midi/UMP, pass other control types
We should only try to convert MIDI/UMP when the port doesn't support it but let all the other control types pass through. Fixes #4692
This commit is contained in:
parent
37dbf93cc4
commit
750b88c3ca
1 changed files with 9 additions and 1 deletions
|
|
@ -671,6 +671,14 @@ static inline int event_sort(struct spa_pod_control *a, struct spa_pod_control *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool control_needs_conversion(struct port *port, uint32_t type)
|
||||||
|
{
|
||||||
|
/* we only converter between midi and UMP and only when the port
|
||||||
|
* does not support the current type */
|
||||||
|
return (type == SPA_CONTROL_Midi || type == SPA_CONTROL_UMP) &&
|
||||||
|
port->types && (port->types & (1u << type)) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int impl_node_process(void *object)
|
static int impl_node_process(void *object)
|
||||||
{
|
{
|
||||||
struct impl *this = object;
|
struct impl *this = object;
|
||||||
|
|
@ -782,7 +790,7 @@ static int impl_node_process(void *object)
|
||||||
if (next == NULL)
|
if (next == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (outport->types && (outport->types & (1u << next->type)) == 0) {
|
if (control_needs_conversion(outport, next->type)) {
|
||||||
uint8_t *data = SPA_POD_BODY(&next->value);
|
uint8_t *data = SPA_POD_BODY(&next->value);
|
||||||
size_t size = SPA_POD_BODY_SIZE(&next->value);
|
size_t size = SPA_POD_BODY_SIZE(&next->value);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue