mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
media-session: always check if session is busy
Also check if the session is busy if we explicitly provided the target session id to join.
This commit is contained in:
parent
2fe392dd30
commit
6e92dbbe23
1 changed files with 6 additions and 4 deletions
|
|
@ -422,12 +422,13 @@ static int find_session(void *data, struct session *sess)
|
||||||
if (strcmp(str, find->media_class) != 0)
|
if (strcmp(str, find->media_class) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
plugged = sess->plugged;
|
||||||
|
}
|
||||||
|
|
||||||
if ((find->exclusive && sess->busy) || sess->exclusive) {
|
if ((find->exclusive && sess->busy) || sess->exclusive) {
|
||||||
pw_log_debug("module %p: session in use", impl);
|
pw_log_debug("module %p: session in use", impl);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
plugged = sess->plugged;
|
|
||||||
}
|
|
||||||
|
|
||||||
pw_log_debug("module %p: found session '%d' %" PRIu64, impl,
|
pw_log_debug("module %p: found session '%d' %" PRIu64, impl,
|
||||||
sess->id, plugged);
|
sess->id, plugged);
|
||||||
|
|
@ -515,6 +516,7 @@ static int handle_autoconnect(struct impl *impl, struct pw_node *node,
|
||||||
|
|
||||||
find.impl = impl;
|
find.impl = impl;
|
||||||
find.sess = NULL;
|
find.sess = NULL;
|
||||||
|
find.plugged = 0;
|
||||||
find.exclusive = exclusive;
|
find.exclusive = exclusive;
|
||||||
spa_list_for_each(session, &impl->session_list, l)
|
spa_list_for_each(session, &impl->session_list, l)
|
||||||
find_session(&find, session);
|
find_session(&find, session);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue