diff --git a/audio/avctp.c b/audio/avctp.c
index b8cb36e..89ef70c 100644
--- a/audio/avctp.c
+++ b/audio/avctp.c
handler = find_handler(handlers, avc->opcode);
if (!handler) {
+ DBG("handler not found for 0x%02x", avc->opcode);
avc->code = AVC_CTYPE_REJECTED;
goto done;
}
if (servers)
return;
- if (passthrough_id)
+ if (passthrough_id) {
avctp_unregister_pdu_handler(passthrough_id);
+ passthrough_id = 0;
+ }
- if (unit_id)
+ if (unit_id) {
avctp_unregister_pdu_handler(unit_id);
+ passthrough_id = 0;
+ }
- if (subunit_id)
- avctp_unregister_pdu_handler(unit_id);
+ if (subunit_id) {
+ avctp_unregister_pdu_handler(subunit_id);
+ subunit_id = 0;
+ }
}
int avctp_send_passthrough(struct avctp *session, uint8_t op)