mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
media-session: don't bluez-autoswitch for suspended/idle/errored streams
E.g. skypeforlinux makes its input streams idle but does not destroy them, when no call is active.
This commit is contained in:
parent
4f8ff41a45
commit
3f8fb6e4dc
1 changed files with 14 additions and 0 deletions
|
|
@ -81,6 +81,7 @@ struct node {
|
||||||
struct spa_hook listener;
|
struct spa_hook listener;
|
||||||
unsigned char active:1;
|
unsigned char active:1;
|
||||||
unsigned char communication:1;
|
unsigned char communication:1;
|
||||||
|
unsigned char was_active:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct find_data {
|
struct find_data {
|
||||||
|
|
@ -473,6 +474,8 @@ static void change_node_state(struct node *node, bool active, bool communication
|
||||||
bool need_switch = false;
|
bool need_switch = false;
|
||||||
struct impl *impl = node->impl;
|
struct impl *impl = node->impl;
|
||||||
|
|
||||||
|
node->was_active = node->was_active || active;
|
||||||
|
|
||||||
if (node->active != active) {
|
if (node->active != active) {
|
||||||
impl->record_count += active ? 1 : -1;
|
impl->record_count += active ? 1 : -1;
|
||||||
node->active = active;
|
node->active = active;
|
||||||
|
|
@ -508,6 +511,17 @@ static void check_node(struct node *node)
|
||||||
spa_atob(str))
|
spa_atob(str))
|
||||||
goto inactive;
|
goto inactive;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX: This is not fully the right thing to do --- the node may be
|
||||||
|
* XXX: idle/suspended also because it's linked to a source that is not
|
||||||
|
* XXX: generating data. However, this seems the closest approximation
|
||||||
|
* XXX: to Pulse corked stream status.
|
||||||
|
*/
|
||||||
|
if (node->was_active && (node->obj->info->state == PW_NODE_STATE_SUSPENDED ||
|
||||||
|
node->obj->info->state == PW_NODE_STATE_IDLE ||
|
||||||
|
node->obj->info->state == PW_NODE_STATE_ERROR))
|
||||||
|
goto inactive;
|
||||||
|
|
||||||
if (spa_streq(pw_properties_get(node->obj->obj.props, PW_KEY_MEDIA_ROLE), "Communication"))
|
if (spa_streq(pw_properties_get(node->obj->obj.props, PW_KEY_MEDIA_ROLE), "Communication"))
|
||||||
communication = true;
|
communication = true;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue