stream: improve node.name

This commit is contained in:
Wim Taymans 2018-04-26 10:26:56 +02:00
parent a6cb6b740c
commit 7f6ac1162d
2 changed files with 12 additions and 1 deletions

View file

@ -586,7 +586,6 @@ static void node_event(void *data, struct spa_event *event)
static void node_process(void *data, int status) static void node_process(void *data, int status)
{ {
struct pw_node *node = data; struct pw_node *node = data;
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
pw_log_trace("node %p: process driver:%d exported:%d", node, node->driver, node->exported); pw_log_trace("node %p: process driver:%d exported:%d", node, node->driver, node->exported);

View file

@ -851,6 +851,7 @@ struct pw_stream * pw_stream_new(struct pw_remote *remote, const char *name,
{ {
struct stream *impl; struct stream *impl;
struct pw_stream *this; struct pw_stream *this;
const char *str;
impl = calloc(1, sizeof(struct stream)); impl = calloc(1, sizeof(struct stream));
if (impl == NULL) if (impl == NULL)
@ -867,6 +868,17 @@ struct pw_stream * pw_stream_new(struct pw_remote *remote, const char *name,
if (props == NULL) if (props == NULL)
goto no_mem; goto no_mem;
if (!pw_properties_get(props, "node.name")) {
const struct pw_properties *p = pw_remote_get_properties(remote);
if ((str = pw_properties_get(p, "application.name")) != NULL)
pw_properties_set(props, "node.name", str);
else if ((str = pw_properties_get(p, "application.prgname")) != NULL)
pw_properties_set(props, "node.name", str);
else
pw_properties_set(props, "node.name", name);
}
this->properties = props; this->properties = props;
this->remote = remote; this->remote = remote;