From d23030cea359cfc286e2c7fc0bcc7eb39a2a21e1 Mon Sep 17 00:00:00 2001 From: Bharat Panda Date: Fri, 6 Nov 2015 16:04:34 +0530 Subject: [PATCH] audio/avrcp: Fixes added for SetAbsoluteVolume Added event support for SetAbsoluteVolume in TG supported_events. Fix rejecting SetAbsoluteVolume without a player. Repo link: http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=d8da70674705a397f287217070f3659c794cf804 http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=85b829bdf15be8180465d91b22bd376c3d339f62 Change-Id: I1a532724765480ad449088371bd9c531d7c035bb --- profiles/audio/avrcp.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 7ccd3dc..991c56c 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -1771,20 +1771,12 @@ static uint8_t avrcp_handle_set_absolute_volume(struct avrcp *session, struct avrcp_header *pdu, uint8_t transaction) { -#ifndef __TIZEN_PATCH__ - struct avrcp_player *player = session->controller->player; -#else - struct avrcp_player *player = target_get_player(session); -#endif uint16_t len = ntohs(pdu->params_len); uint8_t volume; if (len != 1) goto err; - if (!player) - goto err; - volume = pdu->params[0] & 0x7F; media_transport_update_device_volume(session->dev, volume); @@ -3611,7 +3603,8 @@ static void target_init(struct avrcp *session) return; session->supported_events |= - (1 << AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED); + (1 << AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED) | + (1 << AVRCP_EVENT_VOLUME_CHANGED); #ifdef __TIZEN_PATCH__ if (adapter_avrcp_tg_ver < 0x0104) -- 2.7.4