Diff between d8019264d1d299a3198897f36c2a83a276eac23a and b27a4dbce592fc059ff2d27eca869689ed184cb1

Changed Files

File Additions Deletions Status
profiles/audio/transport.c +19 -0 modified
profiles/audio/transport.h +2 -0 modified

Full Patch

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index eae98ed..fd48958 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -898,3 +898,22 @@ uint8_t media_transport_get_device_volume(struct audio_device *dev)
 
 	return 128;
 }
+
+void media_transport_update_device_volume(struct audio_device *dev,
+								uint8_t volume)
+{
+	GSList *l;
+
+	if (dev == NULL)
+		return;
+
+	for (l = transports; l; l = l->next) {
+		struct media_transport *transport = l->data;
+		if (transport->device != dev)
+			continue;
+
+		/* Volume is A2DP only */
+		if (media_endpoint_get_sep(transport->endpoint))
+			media_transport_update_volume(transport, volume);
+	}
+}
diff --git a/profiles/audio/transport.h b/profiles/audio/transport.h
index cd2fd6e..5e5da20 100644
--- a/profiles/audio/transport.h
+++ b/profiles/audio/transport.h
@@ -40,3 +40,5 @@ void transport_get_properties(struct media_transport *transport,
 							DBusMessageIter *iter);
 
 uint8_t media_transport_get_device_volume(struct audio_device *dev);
+void media_transport_update_device_volume(struct audio_device *dev,
+								uint8_t volume);