From cc1b67bfc67fb5c7a9e1b8c9ba287dd48d2ccf36 Mon Sep 17 00:00:00 2001 From: Loïc Collignon Date: Thu, 15 Nov 2018 15:45:30 +0100 Subject: Fix issues with session and policies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a policy does a 'ramp-down' on an audio role, it never does the 'ramp-up' when closing the role that triggered the policy. Also, session handling was very buggy and had to be reworked to allow the policy to do its job. Bug: SPEC-1949 Bug: SPEC-1950 Change-Id: Iabf0e08b87862bf4620870e4b4a1214f699c7e64 Signed-off-by: Loïc Collignon --- ahl-binding/interrupt.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'ahl-binding/interrupt.cpp') diff --git a/ahl-binding/interrupt.cpp b/ahl-binding/interrupt.cpp index b0eebec..5bf0b79 100644 --- a/ahl-binding/interrupt.cpp +++ b/ahl-binding/interrupt.cpp @@ -72,17 +72,13 @@ int interrupt_t::apply(afb_req_t req, const role_t& role) afb_req_fail(req, "Failed to call 'ramp' action on stream", nullptr); return -1; } - json_object* response = nullptr; json_object* jvolold = nullptr; - if (json_object_object_get_ex(result, "response", &response)) + if (json_object_object_get_ex(result, "volold", &jvolold)) { - if (json_object_object_get_ex(response, "volold", &jvolold)) - { - applied_on_.push_back(std::make_tuple(r.uid(), json_object_get_int(jvolold))); - AFB_API_DEBUG(ahl_binding_t::instance().handle(), - "POLICY: Applying a ramp to '%s' stream because '%s' is opened and have higher priority!", - r.stream().c_str(), role.stream().c_str()); - } + applied_on_.push_back(std::make_tuple(r.uid(), json_object_get_int(jvolold))); + AFB_API_DEBUG(ahl_binding_t::instance().handle(), + "POLICY: Applying a ramp to '%s' stream because '%s' is opened and have higher priority!", + r.stream().c_str(), role.stream().c_str()); } } } -- cgit