midi: fix midi event sorting

The high bit is always 1 so we can use only the lower 3 bits for the
priority.
This commit is contained in:
Wim Taymans 2022-12-13 16:41:20 +01:00
parent 144df8675f
commit 50dad68eb4
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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;