audio/transport: Emit Volume changed if endpoint is source

Started by Feryllt Pryderi on Mar 31, 2021

Subsystems (1)

Maintainers (1)

DORMANTno replies

open the first message on its own page

Message details and related content
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(-)
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,
--
2.31.0
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help