[PATCH BlueZ] shared/vcp: fix setting volume back to current value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If there is a volume change request in flight, always update pending
volume. Otherwise, setting the value back to old value before
notification arrives, is wrongly ignored.

Fixes: e77884accdb2 ("shared/vcp: have only one volume change in flight at a time")
---
 src/shared/vcp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/shared/vcp.c b/src/shared/vcp.c
index f0887ad62..321686774 100644
--- a/src/shared/vcp.c
+++ b/src/shared/vcp.c
@@ -2119,15 +2119,15 @@ static bool vcp_set_volume_client(struct bt_vcp *vcp, uint8_t volume)
 	 * the current one completes. This may skip over some volume changes,
 	 * as it only sends a request for the final value.
 	 */
-	if (vcp->volume == volume) {
+	if (vcp->pending_op.timeout_id) {
+		vcp->pending_op.volume = volume;
+		vcp->pending_op.resend = true;
+		return true;
+	} else if (vcp->volume == volume) {
 		/* Do not set to current value, as that doesn't generate
 		 * a notification
 		 */
 		return true;
-	} else if (vcp->pending_op.timeout_id) {
-		vcp->pending_op.volume = volume;
-		vcp->pending_op.resend = true;
-		return true;
 	}
 
 	req.op = BT_VCS_SET_ABSOLUTE_VOL;
-- 
2.48.1





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux