stream: handle node.name fallback better

If we don't have extra properties, set the node.name to the stream
name if it was not otherwise present.
This commit is contained in:
Wim Taymans 2024-04-01 16:23:00 +02:00
parent 63af3a4b5c
commit 0b42ec714d
2 changed files with 12 additions and 8 deletions

View file

@ -1255,10 +1255,12 @@ filter_new(struct pw_context *context, const char *name,
spa_hook_list_init(&impl->hooks);
this->properties = props;
if (pw_properties_get(props, PW_KEY_NODE_NAME) == NULL && extra) {
str = pw_properties_get(extra, PW_KEY_APP_NAME);
if (str == NULL)
str = pw_properties_get(extra, PW_KEY_APP_PROCESS_BINARY);
if ((str = pw_properties_get(props, PW_KEY_NODE_NAME)) == NULL) {
if (extra) {
str = pw_properties_get(extra, PW_KEY_APP_NAME);
if (str == NULL)
str = pw_properties_get(extra, PW_KEY_APP_PROCESS_BINARY);
}
if (str == NULL)
str = name;
pw_properties_set(props, PW_KEY_NODE_NAME, str);

View file

@ -1544,10 +1544,12 @@ stream_new(struct pw_context *context, const char *name,
if (pw_properties_get(props, PW_KEY_STREAM_IS_LIVE) == NULL)
pw_properties_set(props, PW_KEY_STREAM_IS_LIVE, "true");
if (pw_properties_get(props, PW_KEY_NODE_NAME) == NULL && extra) {
str = pw_properties_get(extra, PW_KEY_APP_NAME);
if (str == NULL)
str = pw_properties_get(extra, PW_KEY_APP_PROCESS_BINARY);
if ((str = pw_properties_get(props, PW_KEY_NODE_NAME)) == NULL) {
if (extra) {
str = pw_properties_get(extra, PW_KEY_APP_NAME);
if (str == NULL)
str = pw_properties_get(extra, PW_KEY_APP_PROCESS_BINARY);
}
if (str == NULL)
str = name;
pw_properties_set(props, PW_KEY_NODE_NAME, str);