env vars should override everything

Always first use the env var and then check the properties. So that
PIPEWIRE_CORE=pipewire-1 PIPEWIRE_REMOTE=pipewire-1 make run runs
everything on pipewire-1 sockets regardless of the config files.

Also PIPEWIRE_NODE always needs to be taken into account first.
This commit is contained in:
Wim Taymans 2023-01-24 17:39:54 +01:00
parent 782e0dfb1f
commit c8850f8766
6 changed files with 13 additions and 24 deletions

View file

@ -49,12 +49,11 @@ PW_LOG_TOPIC_EXTERN(mod_topic);
static const char *
get_remote(const struct spa_dict *props)
{
const char *name = NULL;
const char *name;
if (props)
name = getenv("PIPEWIRE_REMOTE");
if ((name == NULL || name[0] == '\0') && props)
name = spa_dict_lookup(props, PW_KEY_REMOTE_NAME);
if (name == NULL || name[0] == '\0')
name = getenv("PIPEWIRE_REMOTE");
if (name == NULL || name[0] == '\0')
name = PW_DEFAULT_REMOTE;
return name;