diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 2d5aa0b5c..ab837f603 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -1027,7 +1027,7 @@ static inline int event_sort(struct spa_pod_control *a, struct spa_pod_control * db = SPA_POD_BODY(&b->value); if ((da[0] & 0xf) != (db[0] & 0xf)) return 0; - return priotab[db[0] >> 5] - priotab[da[0] >> 5]; + return priotab[(db[0]>>4) & 7] - priotab[(da[0]>>4) & 7]; } default: return 0; diff --git a/spa/plugins/control/mixer.c b/spa/plugins/control/mixer.c index 34219ed3c..1ef212b46 100644 --- a/spa/plugins/control/mixer.c +++ b/spa/plugins/control/mixer.c @@ -597,7 +597,7 @@ static inline int event_sort(struct spa_pod_control *a, struct spa_pod_control * db = SPA_POD_BODY(&b->value); if ((da[0] & 0xf) != (db[0] & 0xf)) return 0; - return priotab[db[0] >> 5] - priotab[da[0] >> 5]; + return priotab[(db[0]>>4) & 7] - priotab[(da[0]>>4) & 7]; } default: return 0;