mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
stream: improve node.name
This commit is contained in:
parent
a6cb6b740c
commit
7f6ac1162d
2 changed files with 12 additions and 1 deletions
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue