mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-30 06:46:49 -04:00
milan-avb: acmp: do not return 0xfffe as a guid in the case of a null peer-id
This commit is contained in:
parent
4cabb5842c
commit
6cb03f8e04
1 changed files with 8 additions and 0 deletions
|
|
@ -36,6 +36,10 @@
|
||||||
*/
|
*/
|
||||||
static inline uint64_t entity_id_from_peer_id(uint64_t peer_id)
|
static inline uint64_t entity_id_from_peer_id(uint64_t peer_id)
|
||||||
{
|
{
|
||||||
|
if (peer_id == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return (peer_id & 0xFFFFFF0000000000ULL) |
|
return (peer_id & 0xFFFFFF0000000000ULL) |
|
||||||
(0xFFFEULL << 24) |
|
(0xFFFEULL << 24) |
|
||||||
((peer_id >> 16) & 0xFFFFFFULL);
|
((peer_id >> 16) & 0xFFFFFFULL);
|
||||||
|
|
@ -43,6 +47,10 @@ static inline uint64_t entity_id_from_peer_id(uint64_t peer_id)
|
||||||
|
|
||||||
static inline uint64_t peer_id_from_entity_id(uint64_t entity_id, uint16_t unique_id)
|
static inline uint64_t peer_id_from_entity_id(uint64_t entity_id, uint16_t unique_id)
|
||||||
{
|
{
|
||||||
|
if (entity_id == 0 && unique_id == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return (entity_id & 0xFFFFFF0000000000ULL) |
|
return (entity_id & 0xFFFFFF0000000000ULL) |
|
||||||
((entity_id & 0xFFFFFFULL) << 16) |
|
((entity_id & 0xFFFFFFULL) << 16) |
|
||||||
unique_id;
|
unique_id;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue