Skip to content

Commit

Permalink
media: Register app objects in proxy_added_cb()
Browse files Browse the repository at this point in the history
The proxy_added_cb() function is called every time a new client is added
to the application object manager. Registering media endpoint and player
in that proxy_added_cb() callback function will allow to register new
endpoints and players not only during the initial RegisterApplication
call, but also during the application lifetime. For instance, this might
allow to dynamically enable/disable support for additional codecs.
  • Loading branch information
arkq authored and Vudentz committed Jun 6, 2023
1 parent 8f32fa2 commit 08d6274
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions profiles/audio/media.c
Original file line number Diff line number Diff line change
Expand Up @@ -2821,9 +2821,6 @@ static void client_ready_cb(GDBusClient *client, void *user_data)
goto reply;
}

queue_foreach(app->proxies, app_register_endpoint, app);
queue_foreach(app->proxies, app_register_player, app);

if (app->err) {
if (app->err == -EPROTONOSUPPORT)
reply = btd_error_not_supported(app->reg);
Expand Down Expand Up @@ -2867,6 +2864,10 @@ static void proxy_added_cb(GDBusProxy *proxy, void *user_data)
path = g_dbus_proxy_get_path(proxy);

DBG("Proxy added: %s, iface: %s", path, iface);

app_register_endpoint(proxy, app);
app_register_player(proxy, app);

}

static bool match_endpoint_by_path(const void *a, const void *b)
Expand Down

0 comments on commit 08d6274

Please sign in to comment.