Thread (2 messages) read the whole thread 2 messages, 2 authors, 2013-01-11
STALE4949d

[PATCH BlueZ] AVRCP: Fix crash when MediaPlayer1 is disabled

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2013-01-11 14:19:09
Subsystem: the rest · Maintainer: Linus Torvalds

From: Luiz Augusto von Dentz <redacted>

When MediaPlayer1 is disabled we should not proceed with getting
remote capabilities but switch back to 1.0 mode.
---
 profiles/audio/avrcp.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index d0cc346..ef324b0 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2178,11 +2178,12 @@ static void session_ct_init(struct avrcp *session)
 	path = device_get_path(session->dev->btd_dev);
 
 	mp = media_player_controller_create(path);
-	if (mp != NULL) {
-		media_player_set_callbacks(mp, &ct_cbs, player);
-		player->user_data = mp;
-		player->destroy = (GDestroyNotify) media_player_destroy;
-	}
+	if (mp == NULL)
+		return;
+
+	media_player_set_callbacks(mp, &ct_cbs, player);
+	player->user_data = mp;
+	player->destroy = (GDestroyNotify) media_player_destroy;
 
 	if (session->version < 0x0103)
 		return;
-- 
1.8.0.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help