From 8f544329b90586a87df8a0e14342f1bd5502e5bb Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Tue, 11 Jun 2019 13:28:33 +0300
Subject: [PATCH] remote-endpoint: do not require a stream id on controls

the stream id is optional, a control may apply globally to all streams
---
 modules/module-pipewire/remote-endpoint.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/module-pipewire/remote-endpoint.c b/modules/module-pipewire/remote-endpoint.c
index 8a0dab6a..76ed76c1 100644
--- a/modules/module-pipewire/remote-endpoint.c
+++ b/modules/module-pipewire/remote-endpoint.c
@@ -34,7 +34,6 @@ control_to_pod (GVariant * control, guint32 * control_id,
   const gchar *type;
 
   if (!g_variant_lookup (control, "id", "u", &id) ||
-      !g_variant_lookup (control, "stream-id", "u", &stream_id) ||
       !g_variant_lookup (control, "name", "&s", &name) ||
       !g_variant_lookup (control, "type", "&s", &type) ||
       !g_variant_type_string_is_valid (type))
@@ -48,10 +47,15 @@ control_to_pod (GVariant * control, guint32 * control_id,
       PW_ENDPOINT_OBJECT_ParamControl, PW_ENDPOINT_PARAM_EnumControl);
   spa_pod_builder_add (b,
       PW_ENDPOINT_PARAM_CONTROL_id, SPA_POD_Int (id),
-      PW_ENDPOINT_PARAM_CONTROL_stream_id, SPA_POD_Int (stream_id),
       PW_ENDPOINT_PARAM_CONTROL_name, SPA_POD_String (name),
       NULL);
 
+  if (g_variant_lookup (control, "stream-id", "u", &stream_id)) {
+    spa_pod_builder_add (b,
+        PW_ENDPOINT_PARAM_CONTROL_stream_id, SPA_POD_Int (stream_id),
+        NULL);
+  }
+
   switch (type[0]) {
     case 'b':
     {
-- 
GitLab