From 4a72e991a05a1ab0d82b749477fd00a50708b7272779045b7b726fe5d076c3b9 Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Mon, 10 Jun 2024 09:32:36 +0000 Subject: [PATCH] Accepting request 1178873 from home:XRevan86 - Update to version 0.5.3. OBS-URL: https://build.opensuse.org/request/show/1178873 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=81 --- 0001-lua-json-fix-error-ouput.patch | 34 ----- ...-add-method-to-merge-json-containers.patch | 77 ---------- ...rriding-of-non-container-values-when.patch | 58 -------- ...ransition-fix-memleak-when-error-set.patch | 25 ---- ...-ensure-single-completion-and-finish.patch | 131 ------------------ ...ing-return-after-aborting-transition.patch | 28 ---- ...tate-stream-fix-using-default-volume.patch | 48 ------- _service | 2 +- wireplumber-0.5.2.obscpio | 3 - wireplumber-0.5.3.obscpio | 3 + wireplumber.changes | 56 ++++++++ wireplumber.obsinfo | 6 +- wireplumber.spec | 11 +- 13 files changed, 65 insertions(+), 417 deletions(-) delete mode 100644 0001-lua-json-fix-error-ouput.patch delete mode 100644 0002-lua-json-add-method-to-merge-json-containers.patch delete mode 100644 0003-json-utils-fix-overriding-of-non-container-values-when.patch delete mode 100644 0004-transition-fix-memleak-when-error-set.patch delete mode 100644 0005-transition-ensure-single-completion-and-finish.patch delete mode 100644 0006-linking-return-after-aborting-transition.patch delete mode 100644 0007-state-stream-fix-using-default-volume.patch delete mode 100644 wireplumber-0.5.2.obscpio create mode 100644 wireplumber-0.5.3.obscpio diff --git a/0001-lua-json-fix-error-ouput.patch b/0001-lua-json-fix-error-ouput.patch deleted file mode 100644 index d6d999c..0000000 --- a/0001-lua-json-fix-error-ouput.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 709eecb21f30a157b9a4aa8ab45a4c1ec608d628 Mon Sep 17 00:00:00 2001 -From: Stefan Ursella -Date: Fri, 26 Apr 2024 07:27:31 +0200 -Subject: [PATCH] lua: json: fix error ouput - ---- - modules/module-lua-scripting/api/json.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/modules/module-lua-scripting/api/json.c b/modules/module-lua-scripting/api/json.c -index 242f0e410..5afa5c914 100644 ---- a/modules/module-lua-scripting/api/json.c -+++ b/modules/module-lua-scripting/api/json.c -@@ -281,7 +281,7 @@ spa_json_array_new (lua_State *L) - break; - } - default: -- luaL_error (L, "Json does not support lua type ", -+ luaL_error (L, "Json does not support lua type %s", - lua_typename(L, lua_type(L, -1))); - break; - } -@@ -327,7 +327,7 @@ spa_json_object_new (lua_State *L) - break; - } - default: -- luaL_error (L, "Json does not support lua type ", -+ luaL_error (L, "Json does not support lua type %s", - lua_typename(L, lua_type(L, -1))); - break; - } --- -GitLab - diff --git a/0002-lua-json-add-method-to-merge-json-containers.patch b/0002-lua-json-add-method-to-merge-json-containers.patch deleted file mode 100644 index bb96b90..0000000 --- a/0002-lua-json-add-method-to-merge-json-containers.patch +++ /dev/null @@ -1,77 +0,0 @@ -From fd7a1af7ffec4be04348b4807a4a8f95777e2515 Mon Sep 17 00:00:00 2001 -From: Stefan Ursella -Date: Fri, 26 Apr 2024 07:26:52 +0200 -Subject: [PATCH] lua: json: add method to merge json containers - ---- - modules/module-lua-scripting/api/json.c | 15 +++++++++++++++ - tests/wplua/scripts/json.lua | 23 +++++++++++++++++++++++ - 2 files changed, 38 insertions(+) - -diff --git a/modules/module-lua-scripting/api/json.c b/modules/module-lua-scripting/api/json.c -index 39f6b10f0..242f0e410 100644 ---- a/modules/module-lua-scripting/api/json.c -+++ b/modules/module-lua-scripting/api/json.c -@@ -167,6 +167,20 @@ push_luajson (lua_State *L, WpSpaJson *json, gint n_recursions) - } - } - -+static int -+spa_json_merge (lua_State *L) -+{ -+ WpSpaJson *a = wplua_checkboxed (L, 1, WP_TYPE_SPA_JSON); -+ WpSpaJson *b = wplua_checkboxed (L, 2, WP_TYPE_SPA_JSON); -+ -+ WpSpaJson *merge = wp_json_utils_merge_containers(a, b); -+ if(!merge) -+ luaL_error (L, "only Json container merge supported"); -+ -+ wplua_pushboxed (L, WP_TYPE_SPA_JSON, merge); -+ return 1; -+} -+ - static int - spa_json_parse (lua_State *L) - { -@@ -340,6 +354,7 @@ static const luaL_Reg spa_json_methods[] = { - { "is_array", spa_json_is_array }, - { "is_object", spa_json_is_object }, - { "parse", spa_json_parse }, -+ { "merge", spa_json_merge }, - { NULL, NULL } - }; - -diff --git a/tests/wplua/scripts/json.lua b/tests/wplua/scripts/json.lua -index 52a8a3823..03e14ba6d 100644 ---- a/tests/wplua/scripts/json.lua -+++ b/tests/wplua/scripts/json.lua -@@ -240,3 +240,26 @@ assert (type (val.args) == "table") - assert (type (val.args.test) == "table") - assert (val.args.test[1] == 0) - assert (val.args.test[2] == 1) -+ -+json = Json.Array { "foo" } -+json2 = Json.Array { "bar" } -+json = json:merge(json2) -+assert (json:is_array()) -+val = json:parse () -+assert (val[1] == "foo") -+assert (val[2] == "bar") -+ -+table = {} -+table["1"] = 1 -+table["2"] = 2 -+json = Json.Object (table) -+table = {} -+table["3"] = 3 -+table["4"] = 4 -+json2 = Json.Object (table) -+json = json:merge(json2) -+val = json:parse () -+assert (val["1"] == 1) -+assert (val["2"] == 2) -+assert (val["3"] == 3) -+assert (val["4"] == 4) --- -GitLab - diff --git a/0003-json-utils-fix-overriding-of-non-container-values-when.patch b/0003-json-utils-fix-overriding-of-non-container-values-when.patch deleted file mode 100644 index e319533..0000000 --- a/0003-json-utils-fix-overriding-of-non-container-values-when.patch +++ /dev/null @@ -1,58 +0,0 @@ -From e6a70db254585b2cd9f3265fdafc884a48c3682d Mon Sep 17 00:00:00 2001 -From: George Kiagiadakis -Date: Fri, 3 May 2024 15:54:37 +0300 -Subject: [PATCH] json-utils: fix overriding of non-container values when - merging - -Non-container values should always be overriden - -Fixes: #653 ---- - lib/wp/json-utils.c | 4 ++-- - tests/wplua/scripts/json.lua | 7 +++++++ - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/lib/wp/json-utils.c b/lib/wp/json-utils.c -index 53d1b2b1b..936ad449e 100644 ---- a/lib/wp/json-utils.c -+++ b/lib/wp/json-utils.c -@@ -211,12 +211,12 @@ merge_json_objects (WpSpaJson *a, WpSpaJson *b) - g_return_val_if_fail (wp_iterator_next (it, &item), NULL); - val = g_value_dup_boxed (&item); - -- if (!override && -+ if (!override && wp_spa_json_is_container (val) && - (wp_spa_json_object_get (a, key_str, "J", &j, NULL) || - wp_spa_json_object_get (a, override_key_str, "J", &j, NULL))) { - g_autoptr (WpSpaJson) merged = wp_json_utils_merge_containers (j, val); - if (!merged) { -- wp_warning ("skipping merge of %s as JSON values are not compatible", -+ wp_warning ("skipping merge of %s as JSON values are not compatible containers", - key_str); - continue; - } -diff --git a/tests/wplua/scripts/json.lua b/tests/wplua/scripts/json.lua -index 03e14ba6d..5489bab23 100644 ---- a/tests/wplua/scripts/json.lua -+++ b/tests/wplua/scripts/json.lua -@@ -241,6 +241,7 @@ assert (type (val.args.test) == "table") - assert (val.args.test[1] == 0) - assert (val.args.test[2] == 1) - -+-- merge - json = Json.Array { "foo" } - json2 = Json.Array { "bar" } - json = json:merge(json2) -@@ -263,3 +264,9 @@ assert (val["1"] == 1) - assert (val["2"] == 2) - assert (val["3"] == 3) - assert (val["4"] == 4) -+ -+json = Json.Object { ["a"] = "foo" } -+json2 = Json.Object { ["a"] = "bar" } -+json = json:merge(json2) -+val = json:parse () -+assert (val["a"] == "bar") --- -GitLab - diff --git a/0004-transition-fix-memleak-when-error-set.patch b/0004-transition-fix-memleak-when-error-set.patch deleted file mode 100644 index 98e0e99..0000000 --- a/0004-transition-fix-memleak-when-error-set.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1ddfbc532c87fb0ad18e128d574e5c3b72089416 Mon Sep 17 00:00:00 2001 -From: Barnabas Pocze -Date: Sat, 18 May 2024 00:46:58 +0200 -Subject: [PATCH 4/7] transition: fix memory leak when error is already set - -Fixes: 18377fbf829ff2 ("transition: don't allow _return_error() to be called recursively") ---- - lib/wp/transition.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lib/wp/transition.c b/lib/wp/transition.c -index 547f555f0..0538208f4 100644 ---- a/lib/wp/transition.c -+++ b/lib/wp/transition.c -@@ -493,6 +493,7 @@ wp_transition_return_error (WpTransition * self, GError * error) - if (G_UNLIKELY (priv->error)) { - wp_warning_object (self, "transition bailing out multiple times; " - "new error is: %s", error->message); -+ g_error_free (error); - return; - } - --- -2.45.1 - diff --git a/0005-transition-ensure-single-completion-and-finish.patch b/0005-transition-ensure-single-completion-and-finish.patch deleted file mode 100644 index fa3ef65..0000000 --- a/0005-transition-ensure-single-completion-and-finish.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 89b6766cd6a64c8d52512ae2c091de3f5aae034f Mon Sep 17 00:00:00 2001 -From: Barnabas Pocze -Date: Sat, 18 May 2024 00:53:33 +0200 -Subject: [PATCH 5/7] transition: ensure single completion and finish - -At the moment, the same transition can be completed multiple times -(assuming sufficiently high reference count): - - return_error() - finish() - return_error() - -The consequence of that is that the transition closure will be -invoked multiple times. This is unexpected. - -Add some guards against completing a transition or calling finish() -multiple times. - -Fixes #628 ---- - lib/wp/transition.c | 34 ++++++++++++++++++++++++++++------ - 1 file changed, 28 insertions(+), 6 deletions(-) - -diff --git a/lib/wp/transition.c b/lib/wp/transition.c -index 0538208f4..1e8bba2f5 100644 ---- a/lib/wp/transition.c -+++ b/lib/wp/transition.c -@@ -66,6 +66,8 @@ struct _WpTransitionPrivate - - /* state machine */ - gboolean started; -+ gboolean completed; -+ gboolean finished; - guint step; - GError *error; - }; -@@ -348,8 +350,7 @@ wp_transition_get_completed (WpTransition * self) - g_return_val_if_fail (WP_IS_TRANSITION (self), FALSE); - - WpTransitionPrivate *priv = wp_transition_get_instance_private (self); -- return (priv->step == WP_TRANSITION_STEP_NONE && priv->started) || -- priv->step == WP_TRANSITION_STEP_ERROR; -+ return priv->completed; - } - - /*! -@@ -370,6 +371,8 @@ wp_transition_had_error (WpTransition * self) - static void - wp_transition_return (WpTransition * self, WpTransitionPrivate *priv) - { -+ g_assert (priv->completed); -+ - if (priv->closure) { - GValue values[2] = { G_VALUE_INIT, G_VALUE_INIT }; - g_value_init (&values[0], G_TYPE_OBJECT); -@@ -427,6 +430,11 @@ wp_transition_advance (WpTransition * self) - guint next_step; - GError *error = NULL; - -+ if (priv->completed) { -+ wp_warning_object (priv->source_object, "tried to advance completed transition"); -+ return; -+ } -+ - priv->started = TRUE; - - if (g_cancellable_set_error_if_cancelled (priv->cancellable, &error)) { -@@ -442,17 +450,20 @@ wp_transition_advance (WpTransition * self) - - if (next_step == WP_TRANSITION_STEP_ERROR) { - /* return error if the callback didn't do it already */ -- if (G_UNLIKELY (!priv->error)) { -+ if (G_UNLIKELY (!priv->completed)) { - wp_transition_return_error (self, g_error_new (WP_DOMAIN_LIBRARY, - WP_LIBRARY_ERROR_INVARIANT, "state machine error")); - } - return; - } - -+ g_assert (!priv->completed); -+ - /* if we reached STEP_NONE again, that means we reached the next state */ - if (next_step == WP_TRANSITION_STEP_NONE) { - /* complete the transition */ - priv->step = next_step; -+ priv->completed = TRUE; - wp_transition_return (self, priv); - return; - } -@@ -490,15 +501,16 @@ wp_transition_return_error (WpTransition * self, GError * error) - - /* don't allow _return_error() to be called multiple times, - as it is dangerous to recurse in execute_step() */ -- if (G_UNLIKELY (priv->error)) { -- wp_warning_object (self, "transition bailing out multiple times; " -- "new error is: %s", error->message); -+ if (G_UNLIKELY (priv->completed)) { -+ wp_warning_object (priv->source_object, -+ "tried to set error on completed transition: %s", error->message); - g_error_free (error); - return; - } - - priv->step = WP_TRANSITION_STEP_ERROR; - priv->error = error; -+ priv->completed = TRUE; - - /* allow the implementation to rollback changes */ - if (WP_TRANSITION_GET_CLASS (self)->execute_step) -@@ -535,8 +547,18 @@ wp_transition_finish (GAsyncResult * res, GError ** error) - priv->step = WP_TRANSITION_STEP_ERROR; - g_propagate_error (error, g_error_new (WP_DOMAIN_LIBRARY, - WP_LIBRARY_ERROR_INVARIANT, "finished before starting")); -+ } else if (!priv->completed) { -+ priv->step = WP_TRANSITION_STEP_ERROR; -+ g_propagate_error (error, g_error_new (WP_DOMAIN_LIBRARY, -+ WP_LIBRARY_ERROR_INVARIANT, "finished before completion")); -+ } else if (priv->finished) { -+ priv->step = WP_TRANSITION_STEP_ERROR; -+ g_propagate_error (error, g_error_new (WP_DOMAIN_LIBRARY, -+ WP_LIBRARY_ERROR_INVARIANT, "finished multiple times")); - } - -+ priv->finished = TRUE; -+ - wp_trace_object (priv->source_object, "transition: finished %s", - (priv->step == WP_TRANSITION_STEP_NONE) ? "ok" : "with error"); - --- -2.45.1 - diff --git a/0006-linking-return-after-aborting-transition.patch b/0006-linking-return-after-aborting-transition.patch deleted file mode 100644 index 02e9c0b..0000000 --- a/0006-linking-return-after-aborting-transition.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 4ed51791e03b63adbaf792564aa201a6d71a1050 Mon Sep 17 00:00:00 2001 -From: Barnabas Pocze -Date: Sat, 18 May 2024 01:04:42 +0200 -Subject: [PATCH 6/7] linking: return after aborting transition - -Avoid calling return_error() on the same transition multiple times. - -Fixes: 4b153ec55354da ("link-target.lua: change into a async hook") -See #628 ---- - src/scripts/linking/link-target.lua | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/scripts/linking/link-target.lua b/src/scripts/linking/link-target.lua -index 62be86cec..f49bf513f 100644 ---- a/src/scripts/linking/link-target.lua -+++ b/src/scripts/linking/link-target.lua -@@ -50,6 +50,7 @@ AsyncEventHook { - si_flags.failed_count > 5 then - transition:return_error ("tried to link on last rescan, not retrying " - .. tostring (si_link)) -+ return - end - - if si_props ["item.factory.name"] == "si-audio-virtual" then --- -2.45.1 - diff --git a/0007-state-stream-fix-using-default-volume.patch b/0007-state-stream-fix-using-default-volume.patch deleted file mode 100644 index 06a7737..0000000 --- a/0007-state-stream-fix-using-default-volume.patch +++ /dev/null @@ -1,48 +0,0 @@ -From df8bc12464c6b582fc1a5f46e4a3a025557bc58b Mon Sep 17 00:00:00 2001 -From: George Kiagiadakis -Date: Fri, 24 May 2024 20:36:28 +0300 -Subject: [PATCH 7/7] state-stream: fix using the default volume - -When there was no previous state stored, the default volume was -also not applied because the code would return from the hook early - -Fixes: #655 ---- - src/scripts/node/state-stream.lua | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/scripts/node/state-stream.lua b/src/scripts/node/state-stream.lua -index f5ac95d54..e2fc7efee 100644 ---- a/src/scripts/node/state-stream.lua -+++ b/src/scripts/node/state-stream.lua -@@ -52,10 +52,7 @@ restore_stream_hook = SimpleEventHook { - return - end - -- local stored_values = getStoredStreamProps (key) -- if not stored_values then -- return -- end -+ local stored_values = getStoredStreamProps (key) or {} - - -- restore node Props (volumes, channelMap, etc...) - if Settings.get_boolean ("node.stream.restore-props") and stream_props ["state.restore-props"] ~= "false" -@@ -356,11 +353,14 @@ function buildDefaultChannelVolumes (node) - end - end - -+ log:info (node, "using default volume: " .. tostring(def_vol) .. -+ ", channels: " .. tostring(channels)) -+ - while (#res < channels) do - table.insert(res, def_vol) - end - -- return res; -+ return res - end - - function getStoredStreamProps (key) --- -2.45.1 - diff --git a/_service b/_service index 40ef4d1..2384b8c 100644 --- a/_service +++ b/_service @@ -3,7 +3,7 @@ git https://gitlab.freedesktop.org/pipewire/wireplumber.git - 0.5.2 + 0.5.3 @PARENT_TAG@