mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
media-session: avoid some segfaults
This commit is contained in:
parent
ae51b0acf1
commit
6af00219e1
2 changed files with 6 additions and 0 deletions
|
|
@ -1696,8 +1696,12 @@ int main(int argc, char *argv[])
|
|||
pw_init(&argc, &argv);
|
||||
|
||||
impl.loop = pw_main_loop_new(NULL);
|
||||
if (impl.loop == NULL)
|
||||
return -1;
|
||||
impl.this.loop = pw_main_loop_get_loop(impl.loop);
|
||||
impl.this.context = pw_context_new(impl.this.loop, NULL, 0);
|
||||
if (impl.this.context == NULL)
|
||||
return -1;
|
||||
|
||||
pw_context_add_spa_lib(impl.this.context, "api.bluez5.*", "bluez5/libspa-bluez5");
|
||||
pw_context_add_spa_lib(impl.this.context, "api.alsa.*", "alsa/libspa-alsa");
|
||||
|
|
|
|||
|
|
@ -448,6 +448,8 @@ static int rescan_node(struct impl *impl, struct node *n)
|
|||
if ((obj = sm_media_session_find_object(impl->session, path_id)) != NULL) {
|
||||
if (strcmp(obj->type, PW_TYPE_INTERFACE_Node) == 0) {
|
||||
peer = sm_object_get_data(obj, SESSION_KEY);
|
||||
if (peer == NULL)
|
||||
return -ENOENT;
|
||||
goto do_link;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue