diff mbox series

[BlueZ,v2] audio/transport: Emit Volume changed if endpoint is source

Message ID c06b781d-2bd3-2cc2-03ac-a512305ab389@gmail.com
State New
Headers show
Series [BlueZ,v2] audio/transport: Emit Volume changed if endpoint is source | expand

Commit Message

Feryllt Pryderi March 31, 2021, 8:11 p.m. UTC
Change set_volume to send a Volume PropertyChanged signal also if
transport->sink_watch is set (and not only if source_watch is set).

This fixes volume changes signals not being sent for devices like speakers and
headphone adapters with volume control (like Bose Soundlink Revolve or Fiio BTR5).
---
 profiles/audio/transport.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--
2.31.0
diff mbox series

Patch

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 8248014ae..2d6c0201b 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -644,7 +644,6 @@  static void set_volume(const GDBusPropertyTable *property,
        struct a2dp_transport *a2dp = transport->data;
        uint16_t arg;
        int8_t volume;
-       bool notify;

        if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT16)
                goto error;
@@ -661,8 +660,7 @@  static void set_volume(const GDBusPropertyTable *property,

        a2dp->volume = volume;

-       notify = transport->source_watch ? true : false;
-       if (notify)
+       if (transport->source_watch || transport->sink_watch)
                g_dbus_emit_property_changed(btd_get_dbus_connection(),
                                                transport->path,
                                                MEDIA_TRANSPORT_INTERFACE,