media-session: add dbus property to media-session

This commit is contained in:
Jonas Holmberg 2021-02-09 17:48:01 +01:00 committed by Wim Taymans
parent d624ed26f4
commit f977c45240
2 changed files with 11 additions and 7 deletions

View file

@ -5,6 +5,7 @@ properties = {
# modules.
#mem.mlock-all = false
#context.profile.modules = default,rtkit
#dbus = true
}
spa-libs = {

View file

@ -2349,13 +2349,16 @@ int main(int argc, char *argv[])
support = pw_context_get_support(impl.this.context, &n_support);
impl.dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus);
if (impl.dbus)
impl.this.dbus_connection = spa_dbus_get_connection(impl.dbus, SPA_DBUS_TYPE_SESSION);
if (impl.this.dbus_connection == NULL)
pw_log_warn("no dbus connection");
else
pw_log_debug("got dbus connection %p", impl.this.dbus_connection);
if ((str = pw_properties_get(impl.this.props, "dbus")) == NULL ||
pw_properties_parse_bool(str)) {
impl.dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus);
if (impl.dbus)
impl.this.dbus_connection = spa_dbus_get_connection(impl.dbus, SPA_DBUS_TYPE_SESSION);
if (impl.this.dbus_connection == NULL)
pw_log_warn("no dbus connection");
else
pw_log_debug("got dbus connection %p", impl.this.dbus_connection);
}
if ((res = start_session(&impl)) < 0)
goto exit;