From f3e1378d41e87891b4ca112842359cde52526995 Mon Sep 17 00:00:00 2001 From: zuozhiwei Date: Thu, 23 Apr 2026 10:42:14 +0800 Subject: [PATCH] audioadapter: fix recalc_tag ParamTag direction filter ParamTag on a port describes the peer direction, matching audioconvert port_set_tag. recalc_tag used info.direction == direction and could skip valid tags or forward the wrong param to the follower. Use SPA_DIRECTION_REVERSE(direction) when selecting the enumerated tag. Apply the same fix in videoadapter for videoconvert. --- spa/plugins/audioconvert/audioadapter.c | 2 +- spa/plugins/videoconvert/videoadapter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index 801b736ab..703d54561 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -716,7 +716,7 @@ static int recalc_tag(struct impl *this, struct spa_node *src, enum spa_directio } if ((res = spa_tag_parse(param, &info, &tag_state)) < 0) return res; - if (info.direction == direction) + if (info.direction == SPA_DIRECTION_REVERSE(direction)) break; } return spa_node_port_set_param(dst, SPA_DIRECTION_REVERSE(direction), 0, diff --git a/spa/plugins/videoconvert/videoadapter.c b/spa/plugins/videoconvert/videoadapter.c index fe50413aa..2149700bb 100644 --- a/spa/plugins/videoconvert/videoadapter.c +++ b/spa/plugins/videoconvert/videoadapter.c @@ -725,7 +725,7 @@ static int recalc_tag(struct impl *this, struct spa_node *src, enum spa_directio } if ((res = spa_tag_parse(param, &info, &tag_state)) < 0) return res; - if (info.direction == direction) + if (info.direction == SPA_DIRECTION_REVERSE(direction)) break; } return spa_node_port_set_param(dst, SPA_DIRECTION_REVERSE(direction), 0,