Skip to contentSkip to conversation

audio/avrcp: Reduce the interval of position changed

PATCH New Luiz Augusto von Dentz 1 participant 1 message May 8, 2015 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 audio/avrcp: Reduce the interval of position changed

From: Luiz Augusto von Dentz <[email protected]>

Using UINT32_MAX overflow in Android implementation as it multiple the value by 1000 to get the interval in miliseconds which seem to truncate the value causing it to send position changed too frequently flooding the channel.

---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
profiles/audio/avrcp.c +1 -1
index 245b3fc..60f8cbf 100644
@@ -3228,7 +3228,7 @@ static void avrcp_register_notification(struct avrcp *session, uint8_t event)
 	 * use it to resync.
 	 */
 	if (event == AVRCP_EVENT_PLAYBACK_POS_CHANGED)
-		bt_put_be32(UINT32_MAX, &pdu->params[1]);
+		bt_put_be32(UINT32_MAX / 1000, &pdu->params[1]);
 
 	pdu->params_len = htons(AVRCP_REGISTER_NOTIFICATION_PARAM_LENGTH);
 
Signature · 1 line
2.1.0