From b5fe74e02e94b8848c8296bf3b40558a294032b7 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 31 Oct 2012 12:04:57 +0200 Subject: [PATCH] AVCTP: Fix scope of transactions to be per channel As per AVRCP spec: "It should be noted that transaction labels are scoped to an AVCTP channel, so an AVRCP specific AV/C command and an AVRCP specific browsing command may be outstanding at the same time with the same transaction label." --- audio/avctp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/audio/avctp.c b/audio/avctp.c index 5f6a67795..6ba25e4e0 100644 --- a/audio/avctp.c +++ b/audio/avctp.c @@ -150,6 +150,7 @@ struct avctp_pending_req { struct avctp_channel { struct avctp *session; GIOChannel *io; + uint8_t transaction; guint watch; uint16_t imtu; uint16_t omtu; @@ -1224,17 +1225,16 @@ static struct avctp_pending_req *pending_create(struct avctp_channel *chan, GDestroyNotify destroy) { struct avctp_pending_req *p; - static uint8_t transaction = 0; p = g_new0(struct avctp_pending_req, 1); p->chan = chan; - p->transaction = transaction; + p->transaction = chan->transaction; p->process = process; p->data = data; p->destroy = destroy; - transaction++; - transaction %= 16; + chan->transaction++; + chan->transaction %= 16; return p; } -- 2.47.3